diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-09-05 15:48:48 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-09-05 15:51:37 +0200 |
commit | 5b5c2fb9c08e3e9ee4ed27fce7863055d3c896d1 (patch) | |
tree | 9398b76e8aa82d61e8dd89a9d48af30f2575721e /nixos | |
parent | f3c32cb2c1344c9a831bb9e4f47c1b20527dbe0b (diff) | |
download | nixlib-5b5c2fb9c08e3e9ee4ed27fce7863055d3c896d1.tar nixlib-5b5c2fb9c08e3e9ee4ed27fce7863055d3c896d1.tar.gz nixlib-5b5c2fb9c08e3e9ee4ed27fce7863055d3c896d1.tar.bz2 nixlib-5b5c2fb9c08e3e9ee4ed27fce7863055d3c896d1.tar.lz nixlib-5b5c2fb9c08e3e9ee4ed27fce7863055d3c896d1.tar.xz nixlib-5b5c2fb9c08e3e9ee4ed27fce7863055d3c896d1.tar.zst nixlib-5b5c2fb9c08e3e9ee4ed27fce7863055d3c896d1.zip |
Make the default fonts conditional on services.xserver.enable
We were pulling in 44 MiB of fonts in the default configuration, which is a bit excessive for headless configurations like EC2 instances. Note that dejavu_minimal ensures that remote X11-forwarded applications still have a basic font regardless.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/config/fonts/fonts.nix | 12 | ||||
-rw-r--r-- | nixos/modules/services/x11/xserver.nix | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/nixos/modules/config/fonts/fonts.nix b/nixos/modules/config/fonts/fonts.nix index f913b8c33e56..af3d93fc1bc4 100644 --- a/nixos/modules/config/fonts/fonts.nix +++ b/nixos/modules/config/fonts/fonts.nix @@ -11,17 +11,27 @@ with lib; # TODO: find another name for it. fonts = mkOption { type = types.listOf types.path; + default = []; example = literalExample "[ pkgs.dejavu_fonts ]"; description = "List of primary font paths."; }; + enableDefaultFonts = mkOption { + type = types.bool; + default = false; + description = '' + Enable a basic set of fonts providing several font styles + and families and reasonable coverage of Unicode. + ''; + }; + }; }; config = { - fonts.fonts = + fonts.fonts = mkIf config.fonts.enableDefaultFonts [ pkgs.xorg.fontbhlucidatypewriter100dpi pkgs.xorg.fontbhlucidatypewriter75dpi diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index b03f70385b1f..6c6a1e79ed0e 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -654,6 +654,8 @@ in ${xrandrMonitorSections} ''; + fonts.enableDefaultFonts = mkDefault true; + }; } |