makeFontsConf: refactor for readibility (#299220)

* makeFontsConf: refactor for readibility

and to ease the possibility to override impureFontsDirectories
This commit is contained in:
Matthieu Coudron 2024-04-03 13:23:33 +02:00 committed by GitHub
parent 5c20a69c8c
commit 912d84a6d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,11 @@
{ runCommand, stdenv, lib, libxslt, fontconfig, dejavu_fonts, fontDirectories
, impureFontDirectories ? [
{ runCommand, stdenv, lib, libxslt, fontconfig, dejavu_fonts }:
let fontconfig_ = fontconfig; in
{
fontconfig ? fontconfig_
# an array of fonts, e.g. `[ pkgs.dejavu_fonts.minimal ]`
, fontDirectories
, impureFontDirectories ? [
# nix user profile
"~/.nix-profile/lib/X11/fonts" "~/.nix-profile/share/fonts"
]
@ -11,7 +17,8 @@
# darwin paths
++ lib.optionals stdenv.isDarwin [ "/Library/Fonts" "/System/Library/Fonts" ]
# nix default profile
++ [ "/nix/var/nix/profiles/default/lib/X11/fonts" "/nix/var/nix/profiles/default/share/fonts" ] }:
++ [ "/nix/var/nix/profiles/default/lib/X11/fonts" "/nix/var/nix/profiles/default/share/fonts" ]
}:
runCommand "fonts.conf"
{

View File

@ -21002,10 +21002,7 @@ with pkgs;
fortify-headers = callPackage ../development/libraries/fortify-headers { };
makeFontsConf = let fontconfig_ = fontconfig; in {fontconfig ? fontconfig_, fontDirectories}:
callPackage ../development/libraries/fontconfig/make-fonts-conf.nix {
inherit fontconfig fontDirectories;
};
makeFontsConf = callPackage ../development/libraries/fontconfig/make-fonts-conf.nix { };
makeFontsCache = let fontconfig_ = fontconfig; in {fontconfig ? fontconfig_, fontDirectories}:
callPackage ../development/libraries/fontconfig/make-fonts-cache.nix {