@@ -4,13 +4,15 @@ with lib;
44
55let
66
7+ cfg = config.fonts.fontDir;
8+
79 x11Fonts = pkgs.runCommand "X11-fonts" { preferLocalBuild = true; } ''
810 mkdir -p "$out/share/X11/fonts"
911 font_regexp='.*\.\(ttf\|otf\|pcf\|pfa\|pfb\|bdf\)\(\.gz\)?'
1012 find ${toString config.fonts.fonts} -regex "$font_regexp" \
1113 -exec ln -sf -t "$out/share/X11/fonts" '{}' \;
1214 cd "$out/share/X11/fonts"
13− ${optionalString config.fonts.fontDir.decompressFonts ''
15+ ${optionalString cfg.decompressFonts ''
1416 ${pkgs.gzip}/bin/gunzip -f *.gz
1517 ''}
1618 ${pkgs.xorg.mkfontscale}/bin/mkfontscale
@@ -36,7 +38,7 @@ in
3638
3739 decompressFonts = mkOption {
3840 type = types.bool;
39− default = false;
41+ default = config.programs.xwayland.enable;
4042 description = ''
4143 Whether to decompress fonts in
4244 <filename>/run/current-system/sw/share/X11/fonts</filename>.
@@ -46,7 +48,7 @@ in
4648 };
4749 };
4850
49− config = mkIf config.fonts.fontDir.enable {
51+ config = mkIf cfg.enable {
5052
5153 # This is enough to make a symlink because the xserver
5254 # module already links all /share/X11 paths.