summary refs log tree commit diff
path: root/nixos/modules/services/x11
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 17:37:45 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 18:47:43 +0100
commit408b8b5725c3e6fff75aef772da248d3e95ff414 (patch)
tree692e3b61dbbff85cc97e3becf13a1376dea04a92 /nixos/modules/services/x11
parentd882e1966251880240599d3c1b31e060661506ee (diff)
downloadnixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.gz
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.bz2
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.lz
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.xz
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.zst
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.zip
Add lots of missing option types
Diffstat (limited to 'nixos/modules/services/x11')
-rw-r--r--nixos/modules/services/x11/desktop-managers/default.nix5
-rw-r--r--nixos/modules/services/x11/desktop-managers/kde4.nix4
-rw-r--r--nixos/modules/services/x11/desktop-managers/xfce.nix2
-rw-r--r--nixos/modules/services/x11/display-managers/default.nix7
-rw-r--r--nixos/modules/services/x11/display-managers/kdm.nix9
-rw-r--r--nixos/modules/services/x11/display-managers/slim.nix19
-rw-r--r--nixos/modules/services/x11/window-managers/default.nix1
-rw-r--r--nixos/modules/services/x11/xfs.nix13
-rw-r--r--nixos/modules/services/x11/xserver.nix33
9 files changed, 70 insertions, 23 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/default.nix b/nixos/modules/services/x11/desktop-managers/default.nix
index 7bb2d769780..4bf1e33a295 100644
--- a/nixos/modules/services/x11/desktop-managers/default.nix
+++ b/nixos/modules/services/x11/desktop-managers/default.nix
@@ -24,17 +24,18 @@ in
     services.xserver.desktopManager = {
 
       session = mkOption {
+        internal = true;
         default = [];
         example = singleton
           { name = "kde";
             bgSupport = true;
             start = "...";
           };
-        description = "
+        description = ''
           Internal option used to add some common line to desktop manager
           scripts before forwarding the value to the
           <varname>displayManager</varname>.
-        ";
+        '';
         apply = list: {
           list = map (d: d // {
             manage = "desktop";
diff --git a/nixos/modules/services/x11/desktop-managers/kde4.nix b/nixos/modules/services/x11/desktop-managers/kde4.nix
index 079fc054d19..108b52bb951 100644
--- a/nixos/modules/services/x11/desktop-managers/kde4.nix
+++ b/nixos/modules/services/x11/desktop-managers/kde4.nix
@@ -51,13 +51,13 @@ in
 
     services.xserver.desktopManager.kde4 = {
       enable = mkOption {
+        type = types.bool;
         default = false;
-        example = true;
         description = "Enable the KDE 4 desktop environment.";
       };
 
       phononBackends = mkOption {
-        type = types.listOf types.string;
+        type = types.listOf types.str;
         default = ["gstreamer"];
         example = ["gstreamer" "vlc"];
         description = "Which phonon multimedia backend kde should use";
diff --git a/nixos/modules/services/x11/desktop-managers/xfce.nix b/nixos/modules/services/x11/desktop-managers/xfce.nix
index d7621c82d12..8199829ef90 100644
--- a/nixos/modules/services/x11/desktop-managers/xfce.nix
+++ b/nixos/modules/services/x11/desktop-managers/xfce.nix
@@ -13,8 +13,8 @@ in
   options = {
 
     services.xserver.desktopManager.xfce.enable = mkOption {
+      type = types.bool;
       default = false;
-      example = true;
       description = "Enable the Xfce desktop environment.";
     };
 
diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix
index 0910708002b..c4fce3706dc 100644
--- a/nixos/modules/services/x11/display-managers/default.nix
+++ b/nixos/modules/services/x11/display-managers/default.nix
@@ -166,16 +166,19 @@ in
     services.xserver.displayManager = {
 
       xauthBin = mkOption {
+        internal = true;
         default = "${xorg.xauth}/bin/xauth";
         description = "Path to the <command>xauth</command> program used by display managers.";
       };
 
       xserverBin = mkOption {
+        type = types.path;
         default = "${xorg.xorgserver}/bin/X";
         description = "Path to the X server used by display managers.";
       };
 
       xserverArgs = mkOption {
+        type = types.listOf types.str;
         default = [];
         example = [ "-ac" "-logverbose" "-nolisten tcp" ];
         description = "List of arguments for the X server.";
@@ -183,16 +186,17 @@ in
       };
 
       sessionCommands = mkOption {
+        type = types.lines;
         default = "";
         example =
           ''
             xmessage "Hello World!" &
           '';
-        type = types.string;
         description = "Shell commands executed just before the window or desktop manager is started.";
       };
 
       desktopManagerHandlesLidAndPower = mkOption {
+        type = types.bool;
         default = true;
         description = ''
           Whether the display manager should prevent systemd from handling
@@ -256,6 +260,7 @@ in
         };
 
         environment = mkOption {
+          type = types.attrsOf types.unspecified;
           default = {};
           example = { SLIM_CFGFILE = /etc/slim.conf; };
           description = "Additional environment variables needed by the display manager.";
diff --git a/nixos/modules/services/x11/display-managers/kdm.nix b/nixos/modules/services/x11/display-managers/kdm.nix
index 2e84adcb4ce..c51e7edfddf 100644
--- a/nixos/modules/services/x11/display-managers/kdm.nix
+++ b/nixos/modules/services/x11/display-managers/kdm.nix
@@ -40,7 +40,7 @@ let
       [X-*-Greeter]
       HiddenUsers=root,nixbld1,nixbld2,nixbld3,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9,nixbld10
       PluginsLogin=${kdebase_workspace}/lib/kde4/kgreet_classic.so
-      ${optionalString (cfg.themeDirectory != "")
+      ${optionalString (cfg.themeDirectory != null)
       ''
         UseTheme=true
         Theme=${cfg.themeDirectory}
@@ -78,6 +78,7 @@ in
     services.xserver.displayManager.kdm = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable the KDE display manager.
@@ -85,6 +86,7 @@ in
       };
 
       enableXDMCP = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable XDMCP, which allows remote logins.
@@ -92,7 +94,8 @@ in
       };
 
       themeDirectory = mkOption {
-        default = "";
+        type = types.nullOr types.str;
+        default = null;
         description = ''
           The path to a KDM theme directory. This theme
           will be used by the KDM greeter.
@@ -100,6 +103,7 @@ in
       };
 
       setupScript = mkOption {
+        type = types.lines;
         default = "";
         description = ''
           The path to a KDM setup script. This script is run as root just
@@ -109,6 +113,7 @@ in
       };
 
       extraConfig = mkOption {
+        type = types.lines;
         default = "";
         description = ''
           Options appended to <filename>kdmrc</filename>, the
diff --git a/nixos/modules/services/x11/display-managers/slim.nix b/nixos/modules/services/x11/display-managers/slim.nix
index 01c9fa96c8c..35834ef3764 100644
--- a/nixos/modules/services/x11/display-managers/slim.nix
+++ b/nixos/modules/services/x11/display-managers/slim.nix
@@ -16,7 +16,7 @@ let
       login_cmd exec ${pkgs.stdenv.shell} ${dmcfg.session.script} "%session"
       halt_cmd ${config.systemd.package}/sbin/shutdown -h now
       reboot_cmd ${config.systemd.package}/sbin/shutdown -r now
-      ${optionalString (cfg.defaultUser != "") ("default_user " + cfg.defaultUser)}
+      ${optionalString (cfg.defaultUser != null) ("default_user " + cfg.defaultUser)}
       ${optionalString cfg.autoLogin "auto_login yes"}
     '';
 
@@ -45,6 +45,7 @@ in
     services.xserver.displayManager.slim = {
 
       enable = mkOption {
+        type = types.bool;
         default = config.services.xserver.enable;
         description = ''
           Whether to enable SLiM as the display manager.
@@ -52,11 +53,14 @@ in
       };
 
       theme = mkOption {
+        type = types.nullOr types.path;
         default = null;
-        example = pkgs.fetchurl {
-          url = http://download.berlios.de/slim/slim-wave.tar.gz;
-          sha256 = "0ndr419i5myzcylvxb89m9grl2xyq6fbnyc3lkd711mzlmnnfxdy";
-        };
+        example = literalExample ''
+          pkgs.fetchurl {
+            url = http://download.berlios.de/slim/slim-wave.tar.gz;
+            sha256 = "0ndr419i5myzcylvxb89m9grl2xyq6fbnyc3lkd711mzlmnnfxdy";
+          }
+        '';
         description = ''
           The theme for the SLiM login manager.  If not specified, SLiM's
           default theme is used.  See <link
@@ -66,7 +70,8 @@ in
       };
 
       defaultUser = mkOption {
-        default = "";
+        type = types.nullOr types.str;
+        default = null;
         example = "login";
         description = ''
           The default user to load. If you put a username here you
@@ -76,8 +81,8 @@ in
       };
 
       autoLogin = mkOption {
+        type = types.bool;
         default = false;
-        example = true;
         description = ''
           Automatically log in as the default user.
         '';
diff --git a/nixos/modules/services/x11/window-managers/default.nix b/nixos/modules/services/x11/window-managers/default.nix
index fa06c4be264..93e3b6ddf4c 100644
--- a/nixos/modules/services/x11/window-managers/default.nix
+++ b/nixos/modules/services/x11/window-managers/default.nix
@@ -24,6 +24,7 @@ in
     services.xserver.windowManager = {
 
       session = mkOption {
+        internal = true;
         default = [];
         example = [{
           name = "wmii";
diff --git a/nixos/modules/services/x11/xfs.nix b/nixos/modules/services/x11/xfs.nix
index f4a40dbb08f..44c1d533c3a 100644
--- a/nixos/modules/services/x11/xfs.nix
+++ b/nixos/modules/services/x11/xfs.nix
@@ -17,6 +17,7 @@ in
     services.xfs = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = "Whether to enable the X Font Server.";
       };
@@ -28,10 +29,12 @@ in
 
   ###### implementation
 
-  config = mkIf config.services.xfs.enable (
-  mkAssert config.fonts.enableFontDir "
-    Please enable fontDir (fonts.enableFontDir) to use xfs.
-  " {
+  config = mkIf config.services.xfs.enable {
+
+    assertions = singleton
+      { assertion = config.fonts.enableFontDir;
+        message = "Please enable fonts.enableFontDir to use the X Font Server.";
+      };
 
     jobs.xfs =
       { description = "X Font Server";
@@ -41,6 +44,6 @@ in
         exec = "${pkgs.xorg.xfs}/bin/xfs -config ${configFile}";
       };
 
-  });
+  };
 
 }
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index e391da5c572..89b6d21ebef 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -137,6 +137,7 @@ in
     services.xserver = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable the X server.
@@ -144,6 +145,7 @@ in
       };
 
       autorun = mkOption {
+        type = types.bool;
         default = true;
         description = ''
           Whether to start the X server automatically.
@@ -151,6 +153,7 @@ in
       };
 
       exportConfiguration = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to symlink the X server configuration under
@@ -159,6 +162,7 @@ in
       };
 
       enableTCP = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to allow the X server to accept TCP connections.
@@ -166,12 +170,14 @@ in
       };
 
       modules = mkOption {
+        type = types.listOf types.path;
         default = [];
         example = [ pkgs.xf86_input_wacom ];
         description = "Packages to be added to the module search path of the X server.";
       };
 
       resolutions = mkOption {
+        type = types.listOf types.attrs;
         default = [];
         example = [ { x = 1600; y = 1200; } { x = 1024; y = 786; } ];
         description = ''
@@ -182,6 +188,7 @@ in
       };
 
       videoDriver = mkOption {
+        type = types.nullOr types.str;
         default = null;
         example = "i810";
         description = ''
@@ -192,6 +199,7 @@ in
       };
 
       videoDrivers = mkOption {
+        type = types.listOf types.str;
         # !!! We'd like "nv" here, but it segfaults the X server.
         default = [ "ati" "cirrus" "intel" "vesa" "vmware" ];
         example = [ "vesa" ];
@@ -203,8 +211,8 @@ in
       };
 
       vaapiDrivers = mkOption {
+        type = types.listOf types.path;
         default = [ ];
-        defaultText = "[ pkgs.vaapiIntel pkgs.vaapiVdpau ]";
         example = "[ pkgs.vaapiIntel pkgs.vaapiVdpau ]";
         description = ''
           Packages providing libva acceleration drivers.
@@ -212,6 +220,7 @@ in
       };
 
       driSupport = mkOption {
+        type = types.bool;
         default = true;
         description = ''
           Whether to enable accelerated OpenGL rendering through the
@@ -220,6 +229,7 @@ in
       };
 
       driSupport32Bit = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           On 64-bit systems, whether to support Direct Rendering for
@@ -230,6 +240,7 @@ in
       };
 
       s3tcSupport = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Make S3TC(S3 Texture Compression) via libtxc_dxtn available
@@ -241,6 +252,7 @@ in
       };
 
       startOpenSSHAgent = mkOption {
+        type = types.bool;
         default = true;
         description = ''
           Whether to start the OpenSSH agent when you log in.  The OpenSSH agent
@@ -251,6 +263,7 @@ in
       };
 
       startGnuPGAgent = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to start the GnuPG agent when you log in.  The GnuPG agent
@@ -261,6 +274,7 @@ in
       };
 
       layout = mkOption {
+        type = types.str;
         default = "us";
         description = ''
           Keyboard layout.
@@ -268,6 +282,7 @@ in
       };
 
       xkbModel = mkOption {
+        type = types.str;
         default = "pc104";
         example = "presario";
         description = ''
@@ -276,6 +291,7 @@ in
       };
 
       xkbOptions = mkOption {
+        type = types.str;
         default = "terminate:ctrl_alt_bksp";
         example = "grp:caps_toggle, grp_led:scroll";
         description = ''
@@ -284,6 +300,7 @@ in
       };
 
       xkbVariant = mkOption {
+        type = types.str;
         default = "";
         example = "colemak";
         description = ''
@@ -292,6 +309,7 @@ in
       };
 
       config = mkOption {
+        type = types.lines;
         description = ''
           The contents of the configuration file of the X server
           (<filename>xorg.conf</filename>).
@@ -299,12 +317,14 @@ in
       };
 
       deviceSection = mkOption {
+        type = types.lines;
         default = "";
         example = "VideoRAM 131072";
         description = "Contents of the first Device section of the X server configuration file.";
       };
 
       screenSection = mkOption {
+        type = types.lines;
         default = "";
         example = ''
           Option "RandRRotation" "on"
@@ -313,6 +333,7 @@ in
       };
 
       monitorSection = mkOption {
+        type = types.lines;
         default = "";
         example = "HorizSync 28-49";
         description = "Contents of the first Monitor section of the X server configuration file.";
@@ -334,6 +355,7 @@ in
       };
 
       moduleSection = mkOption {
+        type = types.lines;
         default = "";
         example =
           ''
@@ -344,6 +366,7 @@ in
       };
 
       serverLayoutSection = mkOption {
+        type = types.lines;
         default = "";
         example =
           ''
@@ -353,36 +376,40 @@ in
       };
 
       extraDisplaySettings = mkOption {
+        type = types.lines;
         default = "";
         example = "Virtual 2048 2048";
         description = "Lines to be added to every Display subsection of the Screen section.";
       };
 
       defaultDepth = mkOption {
+        type = types.int;
         default = 0;
         example = 8;
         description = "Default colour depth.";
       };
 
       useXFS = mkOption {
+        # FIXME: what's the type of this option?
         default = false;
         example = "unix/:7100";
         description = "Determines how to connect to the X Font Server.";
       };
 
       tty = mkOption {
+        type = types.int;
         default = 7;
-        example = 9;
         description = "Virtual console for the X server.";
       };
 
       display = mkOption {
+        type = types.int;
         default = 0;
-        example = 1;
         description = "Display number for the X server.";
       };
 
       virtualScreen = mkOption {
+        type = types.nullOr types.attrs;
         default = null;
         example = { x = 2048; y = 2048; };
         description = ''