diff options
author | Nikolay Amiantov <ab@fmap.me> | 2016-02-01 12:19:00 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2016-02-01 12:20:06 +0300 |
commit | 53e0f8b1cdf36574bfede6e62e2ac2739c3ef804 (patch) | |
tree | 685f9ed58b77b54a3ac08d6edb55d442b5f34a96 /nixos | |
parent | b64ca73b81b86ecd8c6ee60619118b8f703f1739 (diff) | |
parent | 7bd9a5b10486643df024786c1297ec2e3a9c6b57 (diff) |
Merge branch 'fontconfig-caches' into staging
Closes #12668, fixes #12648
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/config/fonts/fontconfig.nix | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix index be6662decea6e..e078a75b295ca 100644 --- a/nixos/modules/config/fonts/fontconfig.nix +++ b/nixos/modules/config/fonts/fontconfig.nix @@ -129,6 +129,14 @@ with lib; }; + cache32Bit = mkOption { + default = false; + type = types.bool; + description = '' + Generate system fonts cache for 32-bit applications. + ''; + }; + }; }; @@ -231,12 +239,19 @@ with lib; "${pkgs.fontconfig}/etc/fonts/fonts.conf"; environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/00-nixos.conf".text = - '' + let + cache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.fonts; }; + in '' <?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig> <!-- Font directories --> ${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)} + <!-- Pre-generated font caches --> + <cachedir>${cache pkgs.fontconfig}</cachedir> + ${optionalString (pkgs.stdenv.isx86_64 && config.fonts.fontconfig.cache32Bit) '' + <cachedir>${cache pkgs.pkgsi686Linux.fontconfig}</cachedir> + ''} </fontconfig> ''; |