nixos/fontdir: add option to decompress fonts

This will let Xwayland use the global font folder as font path
This commit is contained in:
Emilio Perez 2020-09-01 15:38:06 +01:00
parent c99bd9bedf
commit f41f53dc49

View File

@ -10,6 +10,9 @@ let
find ${toString config.fonts.fonts} -regex "$font_regexp" \
-exec ln -sf -t "$out/share/X11/fonts" '{}' \;
cd "$out/share/X11/fonts"
${optionalString config.fonts.fontDir.decompressFonts ''
${pkgs.gzip}/bin/gunzip -f *.gz
''}
${pkgs.xorg.mkfontscale}/bin/mkfontscale
${pkgs.xorg.mkfontdir}/bin/mkfontdir
cat $(find ${pkgs.xorg.fontalias}/ -name fonts.alias) >fonts.alias
@ -31,6 +34,14 @@ in
'';
};
decompressFonts = mkOption {
type = types.bool;
default = false;
description = ''
Whether to decompress fonts in
<filename>/run/current-system/sw/share/X11/fonts</filename>.
'';
};
};
};