aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/config/fonts/fontconfig.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/config/fonts/fontconfig.nix')
-rw-r--r--nixpkgs/nixos/modules/config/fonts/fontconfig.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/config/fonts/fontconfig.nix b/nixpkgs/nixos/modules/config/fonts/fontconfig.nix
index 3bfa1893a8b..6ac64b0ec9c 100644
--- a/nixpkgs/nixos/modules/config/fonts/fontconfig.nix
+++ b/nixpkgs/nixos/modules/config/fonts/fontconfig.nix
@@ -45,6 +45,9 @@ let
# generate the font cache setting file for a fontconfig version
# use latest when no version is passed
+ # When cross-compiling, we can’t generate the cache, so we skip the
+ # <cachedir> part. fontconfig still works but is a little slower in
+ # looking things up.
makeCacheConf = { version ? null }:
let
fcPackage = if version == null
@@ -60,11 +63,13 @@ let
<fontconfig>
<!-- Font directories -->
${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
+ ${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
<!-- Pre-generated font caches -->
<cachedir>${cache}</cachedir>
${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) ''
<cachedir>${cache32}</cachedir>
''}
+ ''}
</fontconfig>
'';