1 { runCommand, lib, fontconfig, fontDirectories }:
5 nativeBuildInputs = [ fontconfig.bin ];
6 preferLocalBuild = true;
7 allowSubstitutes = false;
8 passAsFile = [ "fontDirs" ];
10 <!-- Font directories -->
11 ${lib.concatStringsSep "\n" (map (font: "<dir>${font}</dir>") fontDirectories)}
15 export FONTCONFIG_FILE=$(pwd)/fonts.conf
17 cat > fonts.conf << EOF
19 <!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
21 <include>${fontconfig.out}/etc/fonts/fonts.conf</include>
22 <cachedir>$out</cachedir>
24 cat "$fontDirsPath" >> fonts.conf
25 echo "</fontconfig>" >> fonts.conf
30 # This is not a cache dir in the normal sense -- it won't be automatically
32 rm -f "$out/CACHEDIR.TAG"