diff options
author | Emilio Perez <emilio.perez-juarez@diamond.ac.uk> | 2020-08-31 18:40:34 +0100 |
---|---|---|
committer | Emilio Perez <emilio.perez-juarez@diamond.ac.uk> | 2020-10-04 14:56:29 +0100 |
commit | a5c0ba40048734cd091d53454f30d853ed1fb3ca (patch) | |
tree | d508076c0f4425d80243ffe0d9d39181cfb7181c /nixos/modules/config | |
parent | a5618e6187d272b4c498696a53e4bef9df68e45c (diff) |
nixos/fontdir: use regexp to find font files
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/fonts/fontdir.nix | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/nixos/modules/config/fonts/fontdir.nix b/nixos/modules/config/fonts/fontdir.nix index 45d821e7e883c..098038fa6d21e 100644 --- a/nixos/modules/config/fonts/fontdir.nix +++ b/nixos/modules/config/fonts/fontdir.nix @@ -5,13 +5,10 @@ with lib; let x11Fonts = pkgs.runCommand "X11-fonts" { preferLocalBuild = true; } '' - font_formats=('ttf' 'otf' 'pcf' 'pfa' 'pfb' 'bdf') mkdir -p "$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 + font_regexp='.*\.\(ttf\|otf\|pcf\|pfa\|pfb\|bdf\)\(\.gz\)?' + find ${toString config.fonts.fonts} -regex "$font_regexp" \ + -exec ln -sf -t "$out/share/X11-fonts" '{}' \; cd "$out/share/X11-fonts" ${pkgs.xorg.mkfontscale}/bin/mkfontscale ${pkgs.xorg.mkfontdir}/bin/mkfontdir |