diff options
author | Emilio Perez <emilio.perez-juarez@diamond.ac.uk> | 2020-08-30 21:39:27 +0100 |
---|---|---|
committer | Emilio Perez <emilio.perez-juarez@diamond.ac.uk> | 2020-10-04 14:56:29 +0100 |
commit | a5618e6187d272b4c498696a53e4bef9df68e45c (patch) | |
tree | 3b01e05f3f78bfc8ac9e283826de249263e35556 /nixos/modules/config | |
parent | e940c41a9ca386ee904d3a419f01fbd72d6d70e9 (diff) |
nixos/fontdir: gather more font formats
- Fix wrong order in which font indexes are created mkfontdir requires the file fonts.scale to consider scalable fonts, thus, mkfontscale should be run before - Search more font formats, in particular, bit-mapped formats
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/fonts/fontdir.nix | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/nixos/modules/config/fonts/fontdir.nix b/nixos/modules/config/fonts/fontdir.nix index a6aa84ae8224b..45d821e7e883c 100644 --- a/nixos/modules/config/fonts/fontdir.nix +++ b/nixos/modules/config/fonts/fontdir.nix @@ -5,14 +5,16 @@ with lib; let x11Fonts = pkgs.runCommand "X11-fonts" { preferLocalBuild = true; } '' + font_formats=('ttf' 'otf' 'pcf' 'pfa' 'pfb' 'bdf') mkdir -p "$out/share/X11-fonts" - find ${toString config.fonts.fonts} \ - \( -name fonts.dir -o -name '*.ttf' -o -name '*.otf' \) \ - -exec ln -sf -t "$out/share/X11-fonts" '{}' \; + for fmt in "''${font_formats[@]}"; do + find ${toString config.fonts.fonts} \ + \( -name '*.'$fmt -o -name '*.'$fmt'.gz' \) \ + -exec ln -sf -t "$out/share/X11-fonts" '{}' \; + done cd "$out/share/X11-fonts" - rm -f fonts.dir fonts.scale fonts.alias - ${pkgs.xorg.mkfontdir}/bin/mkfontdir ${pkgs.xorg.mkfontscale}/bin/mkfontscale + ${pkgs.xorg.mkfontdir}/bin/mkfontdir cat $(find ${pkgs.xorg.fontalias}/ -name fonts.alias) >fonts.alias ''; |