diff options
author | Emilio Perez <emilio.perez-juarez@diamond.ac.uk> | 2020-09-02 02:59:58 +0100 |
---|---|---|
committer | Emilio Perez <emilio.perez-juarez@diamond.ac.uk> | 2020-10-04 14:56:30 +0100 |
commit | 52f028f2d9f398e891f4a23056ec9e16c4beb409 (patch) | |
tree | 5bdf4434ae26f9edf0f19802d487d8b371bda746 /nixos/modules/config | |
parent | f41f53dc49d4d593bfeb977c05b8a730fd3654dd (diff) |
nixos/xwayland: add new module and allow configuring a default font path
- Add option `programs.xwayland.defaultFontPath` - Modify sway to enable Xwayland
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/fonts/fontdir.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nixos/modules/config/fonts/fontdir.nix b/nixos/modules/config/fonts/fontdir.nix index 282f2425b061f..264d73ebafa53 100644 --- a/nixos/modules/config/fonts/fontdir.nix +++ b/nixos/modules/config/fonts/fontdir.nix @@ -4,13 +4,15 @@ with lib; let + cfg = config.fonts.fontDir; + x11Fonts = pkgs.runCommand "X11-fonts" { preferLocalBuild = true; } '' mkdir -p "$out/share/X11/fonts" 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" - ${optionalString config.fonts.fontDir.decompressFonts '' + ${optionalString cfg.decompressFonts '' ${pkgs.gzip}/bin/gunzip -f *.gz ''} ${pkgs.xorg.mkfontscale}/bin/mkfontscale @@ -36,7 +38,7 @@ in decompressFonts = mkOption { type = types.bool; - default = false; + default = config.programs.xwayland.enable; description = '' Whether to decompress fonts in <filename>/run/current-system/sw/share/X11/fonts</filename>. @@ -46,7 +48,7 @@ in }; }; - config = mkIf config.fonts.fontDir.enable { + config = mkIf cfg.enable { # This is enough to make a symlink because the xserver # module already links all /share/X11 paths. |