summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-05 15:48:48 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-05 15:51:37 +0200
commit5b5c2fb9c08e3e9ee4ed27fce7863055d3c896d1 (patch)
tree9398b76e8aa82d61e8dd89a9d48af30f2575721e /nixos/modules/config
parentf3c32cb2c1344c9a831bb9e4f47c1b20527dbe0b (diff)
downloadnixlib-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/modules/config')
-rw-r--r--nixos/modules/config/fonts/fonts.nix12
1 files changed, 11 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