diff options
author | Matthieu Coudron <886074+teto@users.noreply.github.com> | 2024-04-03 13:23:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 13:23:33 +0200 |
commit | 912d84a6d84aaab59bf5e4da4050abea6a7be00b (patch) | |
tree | 927b1d7fa8cdba16be9659e73420ee7faa4c25bb | |
parent | 5c20a69c8cf31425883bd84c91d3fe0b094bee26 (diff) |
makeFontsConf: refactor for readibility (#299220)
* makeFontsConf: refactor for readibility and to ease the possibility to override impureFontsDirectories
-rw-r--r-- | pkgs/development/libraries/fontconfig/make-fonts-conf.nix | 13 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 5 |
2 files changed, 11 insertions, 7 deletions
diff --git a/pkgs/development/libraries/fontconfig/make-fonts-conf.nix b/pkgs/development/libraries/fontconfig/make-fonts-conf.nix index cfe0a21e1d35c..a03f7446b0ab0 100644 --- a/pkgs/development/libraries/fontconfig/make-fonts-conf.nix +++ b/pkgs/development/libraries/fontconfig/make-fonts-conf.nix @@ -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" { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c1fb55c5584c9..2fb5c5e564cbb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { |