summary refs log tree commit diff
path: root/nixos/modules/services
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
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')
-rw-r--r--nixos/modules/services/databases/postgresql.nix17
-rw-r--r--nixos/modules/services/hardware/acpid.nix4
-rw-r--r--nixos/modules/services/hardware/bluetooth.nix1
-rw-r--r--nixos/modules/services/hardware/sane.nix29
-rw-r--r--nixos/modules/services/hardware/udev.nix1
-rw-r--r--nixos/modules/services/hardware/udisks.nix1
-rw-r--r--nixos/modules/services/hardware/udisks2.nix1
-rw-r--r--nixos/modules/services/hardware/upower.nix1
-rw-r--r--nixos/modules/services/logging/syslogd.nix4
-rw-r--r--nixos/modules/services/misc/nix-daemon.nix32
-rw-r--r--nixos/modules/services/misc/nixos-manual.nix4
-rw-r--r--nixos/modules/services/misc/rogue.nix2
-rw-r--r--nixos/modules/services/networking/firewall.nix6
-rw-r--r--nixos/modules/services/networking/nat.nix11
-rw-r--r--nixos/modules/services/networking/rpcbind.nix1
-rw-r--r--nixos/modules/services/networking/ssh/sshd.nix15
-rw-r--r--nixos/modules/services/printing/cupsd.nix11
-rw-r--r--nixos/modules/services/scheduling/atd.nix11
-rw-r--r--nixos/modules/services/scheduling/cron.nix22
-rw-r--r--nixos/modules/services/scheduling/fcron.nix17
-rw-r--r--nixos/modules/services/system/dbus.nix1
-rw-r--r--nixos/modules/services/system/nscd.nix1
-rw-r--r--nixos/modules/services/ttys/agetty.nix2
-rw-r--r--nixos/modules/services/ttys/gpm.nix2
-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
33 files changed, 210 insertions, 80 deletions
diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix
index 1c43dad1d50..73447e3cf0d 100644
--- a/nixos/modules/services/databases/postgresql.nix
+++ b/nixos/modules/services/databases/postgresql.nix
@@ -46,6 +46,7 @@ in
     services.postgresql = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to run PostgreSQL.
@@ -53,6 +54,7 @@ in
       };
 
       package = mkOption {
+        type = types.path;
         example = literalExample "pkgs.postgresql92";
         description = ''
           PostgreSQL package to use.
@@ -60,6 +62,7 @@ in
       };
 
       port = mkOption {
+        type = types.int;
         default = "5432";
         description = ''
           Port for PostgreSQL.
@@ -67,6 +70,7 @@ in
       };
 
       dataDir = mkOption {
+        type = types.path;
         default = "/var/db/postgresql";
         description = ''
           Data directory for PostgreSQL.
@@ -74,6 +78,7 @@ in
       };
 
       authentication = mkOption {
+        type = types.lines;
         default = "";
         description = ''
           Defines how users authenticate themselves to the server.
@@ -81,6 +86,7 @@ in
       };
 
       identMap = mkOption {
+        type = types.lines;
         default = "";
         description = ''
           Defines the mapping from system users to database users.
@@ -88,14 +94,15 @@ in
       };
 
       initialScript = mkOption {
-        default = null;
         type = types.nullOr types.path;
+        default = null;
         description = ''
           A file containing SQL statements to execute on first startup.
         '';
       };
 
       enableTCPIP = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to run PostgreSQL with -i flag to enable TCP/IP connections.
@@ -103,8 +110,9 @@ in
       };
 
       extraPlugins = mkOption {
+        type = types.listOf types.path;
         default = [];
-        example = "pkgs.postgis"; # of course don't use a string here!
+        example = literalExample "pkgs.postgis";
         description = ''
           When this list contains elements a new store path is created.
           PostgreSQL and the elments are symlinked into it. Then pg_config,
@@ -118,15 +126,16 @@ in
       };
 
       extraConfig = mkOption {
+        type = types.lines;
         default = "";
         description = "Additional text to be appended to <filename>postgresql.conf</filename>.";
       };
 
       recoveryConfig = mkOption {
+        type = types.nullOr types.lines;
         default = null;
-        type = types.nullOr types.string;
         description = ''
-          Values to put into recovery.conf file.
+          Contents of the <filename>recovery.conf</filename> file.
         '';
       };
     };
diff --git a/nixos/modules/services/hardware/acpid.nix b/nixos/modules/services/hardware/acpid.nix
index 6a595f8306b..adba6394dcf 100644
--- a/nixos/modules/services/hardware/acpid.nix
+++ b/nixos/modules/services/hardware/acpid.nix
@@ -66,21 +66,25 @@ in
     services.acpid = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = "Whether to enable the ACPI daemon.";
       };
 
       powerEventCommands = mkOption {
+        type = types.lines;
         default = "";
         description = "Shell commands to execute on a button/power.* event.";
       };
 
       lidEventCommands = mkOption {
+        type = types.lines;
         default = "";
         description = "Shell commands to execute on a button/lid.* event.";
       };
 
       acEventCommands = mkOption {
+        type = types.lines;
         default = "";
         description = "Shell commands to execute on an ac_adapter.* event.";
       };
diff --git a/nixos/modules/services/hardware/bluetooth.nix b/nixos/modules/services/hardware/bluetooth.nix
index 6bc0ad0bf77..b0714a3ce80 100644
--- a/nixos/modules/services/hardware/bluetooth.nix
+++ b/nixos/modules/services/hardware/bluetooth.nix
@@ -9,6 +9,7 @@ with pkgs.lib;
   options = {
 
     hardware.bluetooth.enable = mkOption {
+      type = types.bool;
       default = false;
       description = "Whether to enable support for Bluetooth.";
     };
diff --git a/nixos/modules/services/hardware/sane.nix b/nixos/modules/services/hardware/sane.nix
index 905445f22c1..5979feb8240 100644
--- a/nixos/modules/services/hardware/sane.nix
+++ b/nixos/modules/services/hardware/sane.nix
@@ -2,6 +2,12 @@
 
 with pkgs.lib;
 
+let
+
+  pkg = if config.hardware.sane.snapshot then pkgs.saneBackendsGit else pkgs.saneBackends;
+
+in
+
 {
 
   ###### interface
@@ -9,11 +15,13 @@ with pkgs.lib;
   options = {
 
     hardware.sane.enable = mkOption {
+      type = types.bool;
       default = false;
       description = "Enable support for SANE scanners.";
     };
 
     hardware.sane.snapshot = mkOption {
+      type = types.bool;
       default = false;
       description = "Use a development snapshot of SANE scanner drivers.";
     };
@@ -23,18 +31,13 @@ with pkgs.lib;
 
   ###### implementation
 
-    config = let pkg = if config.hardware.sane.snapshot
-                          then pkgs.saneBackendsGit
-                          else pkgs.saneBackends;
-      in mkIf config.hardware.sane.enable {
-           environment.systemPackages = [ pkg ];
-           services.udev.packages = [ pkg ];
-           
-           users.extraGroups = singleton {
-             name = "scanner";
-             gid = config.ids.gids.scanner;
-           };
-
-      };
+  config = mkIf config.hardware.sane.enable {
+
+    environment.systemPackages = [ pkg ];
+    services.udev.packages = [ pkg ];
+
+    users.extraGroups."scanner".gid = config.ids.gids.scanner;
+
+  };
 
 }
diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix
index 75f01fbc5a9..516569c0280 100644
--- a/nixos/modules/services/hardware/udev.nix
+++ b/nixos/modules/services/hardware/udev.nix
@@ -114,6 +114,7 @@ in
   options = {
 
     boot.hardwareScan = mkOption {
+      type = types.bool;
       default = true;
       description = ''
         Whether to try to load kernel modules for all detected hardware.
diff --git a/nixos/modules/services/hardware/udisks.nix b/nixos/modules/services/hardware/udisks.nix
index 1ba17c589d2..531ee192573 100644
--- a/nixos/modules/services/hardware/udisks.nix
+++ b/nixos/modules/services/hardware/udisks.nix
@@ -13,6 +13,7 @@ with pkgs.lib;
     services.udisks = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable Udisks, a DBus service that allows
diff --git a/nixos/modules/services/hardware/udisks2.nix b/nixos/modules/services/hardware/udisks2.nix
index eae4172ccb3..178ec379ff1 100644
--- a/nixos/modules/services/hardware/udisks2.nix
+++ b/nixos/modules/services/hardware/udisks2.nix
@@ -13,6 +13,7 @@ with pkgs.lib;
     services.udisks2 = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable Udisks, a DBus service that allows
diff --git a/nixos/modules/services/hardware/upower.nix b/nixos/modules/services/hardware/upower.nix
index 5d1658adb75..4a9b13d4aa0 100644
--- a/nixos/modules/services/hardware/upower.nix
+++ b/nixos/modules/services/hardware/upower.nix
@@ -13,6 +13,7 @@ with pkgs.lib;
     services.upower = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable Upower, a DBus service that provides power
diff --git a/nixos/modules/services/logging/syslogd.nix b/nixos/modules/services/logging/syslogd.nix
index c1a66aaa3cc..36a0ace927a 100644
--- a/nixos/modules/services/logging/syslogd.nix
+++ b/nixos/modules/services/logging/syslogd.nix
@@ -55,7 +55,7 @@ in
       };
 
       defaultConfig = mkOption {
-        type = types.string;
+        type = types.lines;
         default = defaultConf;
         description = ''
           The default <filename>syslog.conf</filename> file configures a
@@ -73,7 +73,7 @@ in
       };
 
       extraConfig = mkOption {
-        type = types.string;
+        type = types.lines;
         default = "";
         example = "news.* -/var/log/news";
         description = ''
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index 6971fe496b2..1707828d0db 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -66,8 +66,9 @@ in
       };
 
       maxJobs = mkOption {
+        type = types.int;
         default = 1;
-        example = 2;
+        example = 64;
         description = "
           This option defines the maximum number of jobs that Nix will try
           to build in parallel.  The default is 1.  You should generally
@@ -77,8 +78,8 @@ in
       };
 
       useChroot = mkOption {
+        type = types.bool;
         default = false;
-        example = true;
         description = "
           If set, Nix will perform builds in a chroot-environment that it
           will set up automatically for each build.  This prevents
@@ -88,6 +89,7 @@ in
       };
 
       chrootDirs = mkOption {
+        type = types.listOf types.str;
         default = [];
         example = [ "/dev" "/proc" ];
         description =
@@ -98,6 +100,7 @@ in
       };
 
       extraOptions = mkOption {
+        type = types.lines;
         default = "";
         example = ''
           gc-keep-outputs = true
@@ -107,6 +110,7 @@ in
       };
 
       distributedBuilds = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to distribute builds to the machines listed in
@@ -115,22 +119,25 @@ in
       };
 
       daemonNiceLevel = mkOption {
+        type = types.int;
         default = 0;
-        description = "
+        description = ''
           Nix daemon process priority. This priority propagates to build processes.
           0 is the default Unix process priority, 20 is the lowest.
-        ";
+        '';
       };
 
       daemonIONiceLevel = mkOption {
+        type = types.int;
         default = 0;
-        description = "
+        description = ''
           Nix daemon process I/O priority. This priority propagates to build processes.
           0 is the default Unix process I/O priority, 7 is the lowest.
-        ";
+        '';
       };
 
       buildMachines = mkOption {
+        type = types.listOf types.attrs;
         default = [];
         example = [
           { hostName = "voila.labs.cs.uu.nl";
@@ -176,24 +183,26 @@ in
       };
 
       proxy = mkOption {
+        type = types.str;
         default = "";
-        description = "
+        description = ''
           This option specifies the proxy to use for fetchurl. The real effect
           is just exporting http_proxy, https_proxy and ftp_proxy with that
           value.
-        ";
+        '';
         example = "http://127.0.0.1:3128";
       };
 
       # Environment variables for running Nix.
       envVars = mkOption {
+        type = types.attrs;
         internal = true;
         default = {};
-        type = types.attrs;
         description = "Environment variables used by Nix.";
       };
 
       nrBuildUsers = mkOption {
+        type = types.int;
         default = 10;
         description = ''
           Number of <literal>nixbld</literal> user accounts created to
@@ -204,6 +213,7 @@ in
       };
 
       readOnlyStore = mkOption {
+        type = types.bool;
         default = true;
         description = ''
           If set, NixOS will enforce the immutability of the Nix store
@@ -214,8 +224,8 @@ in
       };
 
       binaryCaches = mkOption {
+        type = types.listOf types.str;
         default = [ http://cache.nixos.org/ ];
-        type = types.listOf types.string;
         description = ''
           List of binary cache URLs used to obtain pre-built binaries
           of Nix packages.
@@ -223,9 +233,9 @@ in
       };
 
       trustedBinaryCaches = mkOption {
+        type = types.listOf types.str;
         default = [ ];
         example = [ http://hydra.nixos.org/ ];
-        type = types.listOf types.string;
         description = ''
           List of binary cache URLs that non-root users can use (in
           addition to those specified using
diff --git a/nixos/modules/services/misc/nixos-manual.nix b/nixos/modules/services/misc/nixos-manual.nix
index f67afb747e9..885b8fa2d0c 100644
--- a/nixos/modules/services/misc/nixos-manual.nix
+++ b/nixos/modules/services/misc/nixos-manual.nix
@@ -53,14 +53,15 @@ in
   options = {
 
     services.nixosManual.enable = mkOption {
-      default = true;
       type = types.bool;
+      default = true;
       description = ''
         Whether to build the NixOS manual pages.
       '';
     };
 
     services.nixosManual.showManual = mkOption {
+      type = types.bool;
       default = false;
       description = ''
         Whether to show the NixOS manual on one of the virtual
@@ -76,6 +77,7 @@ in
     };
 
     services.nixosManual.browser = mkOption {
+      type = types.path;
       default = "${pkgs.w3m}/bin/w3m";
       description = ''
         Browser used to show the manual.
diff --git a/nixos/modules/services/misc/rogue.nix b/nixos/modules/services/misc/rogue.nix
index 94fa8850750..de25cc0fb98 100644
--- a/nixos/modules/services/misc/rogue.nix
+++ b/nixos/modules/services/misc/rogue.nix
@@ -17,6 +17,7 @@ in
   options = {
 
     services.rogue.enable = mkOption {
+      type = types.bool;
       default = false;
       description = ''
         Whether to enable the Rogue game on one of the virtual
@@ -25,6 +26,7 @@ in
     };
 
     services.rogue.tty = mkOption {
+      type = types.str;
       default = "tty9";
       description = ''
         Virtual console on which to run Rogue.
diff --git a/nixos/modules/services/networking/firewall.nix b/nixos/modules/services/networking/firewall.nix
index b24ac2d7032..4ed859c2e7e 100644
--- a/nixos/modules/services/networking/firewall.nix
+++ b/nixos/modules/services/networking/firewall.nix
@@ -53,6 +53,7 @@ in
   options = {
 
     networking.firewall.enable = mkOption {
+      type = types.bool;
       default = false;
       description =
         ''
@@ -64,6 +65,7 @@ in
     };
 
     networking.firewall.logRefusedConnections = mkOption {
+      type = types.bool;
       default = true;
       description =
         ''
@@ -72,6 +74,7 @@ in
     };
 
     networking.firewall.logRefusedPackets = mkOption {
+      type = types.bool;
       default = false;
       description =
         ''
@@ -82,6 +85,7 @@ in
     };
 
     networking.firewall.logRefusedUnicastsOnly = mkOption {
+      type = types.bool;
       default = true;
       description =
         ''
@@ -93,6 +97,7 @@ in
     };
 
     networking.firewall.rejectPackets = mkOption {
+      type = types.bool;
       default = false;
       description =
         ''
@@ -193,6 +198,7 @@ in
     };
 
     networking.firewall.extraCommands = mkOption {
+      type = types.lines;
       default = "";
       example = "iptables -A INPUT -p icmp -j ACCEPT";
       description =
diff --git a/nixos/modules/services/networking/nat.nix b/nixos/modules/services/networking/nat.nix
index 9d62a764f06..ce28f018828 100644
--- a/nixos/modules/services/networking/nat.nix
+++ b/nixos/modules/services/networking/nat.nix
@@ -19,6 +19,7 @@ in
   options = {
 
     networking.nat.enable = mkOption {
+      type = types.bool;
       default = false;
       description =
         ''
@@ -27,6 +28,7 @@ in
     };
 
     networking.nat.internalIPs = mkOption {
+      type = types.listOf types.str;
       example = [ "192.168.1.0/24" ] ;
       description =
         ''
@@ -34,12 +36,10 @@ in
           coming from these networks and destined for the external
           interface will be rewritten.
         '';
-      # Backward compatibility: this used to be a single range instead
-      # of a list.
-      apply = x: if isList x then x else [x];
     };
 
     networking.nat.externalInterface = mkOption {
+      type = types.str;
       example = "eth1";
       description =
         ''
@@ -48,7 +48,8 @@ in
     };
 
     networking.nat.externalIP = mkOption {
-      default = "";
+      type = types.nullOr types.str;
+      default = null;
       example = "203.0.113.123";
       description =
         ''
@@ -86,7 +87,7 @@ in
             ''
             iptables -t nat -A POSTROUTING \
               -s ${network} -o ${cfg.externalInterface} \
-              ${if cfg.externalIP == ""
+              ${if cfg.externalIP == null
                 then "-j MASQUERADE"
                 else "-j SNAT --to-source ${cfg.externalIP}"}
             ''
diff --git a/nixos/modules/services/networking/rpcbind.nix b/nixos/modules/services/networking/rpcbind.nix
index 00c958c5a4a..c966f85e260 100644
--- a/nixos/modules/services/networking/rpcbind.nix
+++ b/nixos/modules/services/networking/rpcbind.nix
@@ -40,6 +40,7 @@ in
     services.rpcbind = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable `rpcbind', an ONC RPC directory service
diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix
index 360c745f362..48eddb3b2f6 100644
--- a/nixos/modules/services/networking/ssh/sshd.nix
+++ b/nixos/modules/services/networking/ssh/sshd.nix
@@ -27,7 +27,7 @@ let
 
     openssh.authorizedKeys = {
       keys = mkOption {
-        type = types.listOf types.string;
+        type = types.listOf types.str;
         default = [];
         description = ''
           A list of verbatim OpenSSH public keys that should be added to the
@@ -39,6 +39,7 @@ let
       };
 
       keyFiles = mkOption {
+        type = types.listOf types.str;
         default = [];
         description = ''
           A list of files each containing one OpenSSH public key that should be
@@ -77,6 +78,7 @@ in
     services.openssh = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable the OpenSSH secure shell daemon, which
@@ -85,6 +87,7 @@ in
       };
 
       forwardX11 = mkOption {
+        type = types.bool;
         default = cfgc.setXAuthLocation;
         description = ''
           Whether to allow X11 connections to be forwarded.
@@ -92,6 +95,7 @@ in
       };
 
       allowSFTP = mkOption {
+        type = types.bool;
         default = true;
         description = ''
           Whether to enable the SFTP subsystem in the SSH daemon.  This
@@ -112,6 +116,7 @@ in
       };
 
       gatewayPorts = mkOption {
+        type = types.str;
         default = "no";
         description = ''
           Specifies whether remote hosts are allowed to connect to
@@ -122,6 +127,7 @@ in
       };
 
       ports = mkOption {
+        type = types.listOf types.int;
         default = [22];
         description = ''
           Specifies on which ports the SSH daemon listens.
@@ -129,6 +135,7 @@ in
       };
 
       passwordAuthentication = mkOption {
+        type = types.bool;
         default = true;
         description = ''
           Specifies whether password authentication is allowed.
@@ -136,6 +143,7 @@ in
       };
 
       challengeResponseAuthentication = mkOption {
+        type = types.bool;
         default = true;
         description = ''
           Specifies whether challenge/response authentication is allowed.
@@ -143,6 +151,7 @@ in
       };
 
       hostKeys = mkOption {
+        type = types.listOf types.attrs;
         default =
           [ { path = "/etc/ssh/ssh_host_dsa_key";
               type = "dsa";
@@ -163,11 +172,13 @@ in
       };
 
       authorizedKeysFiles = mkOption {
+        type = types.listOf types.str;
         default = [];
         description = "Files from with authorized keys are read.";
       };
 
       extraConfig = mkOption {
+        type = types.lines;
         default = "";
         description = "Verbatim contents of <filename>sshd_config</filename>.";
       };
@@ -202,7 +213,7 @@ in
               The path to the public key file for the host. The public
               key file is read at build time and saved in the Nix store.
               You can fetch a public key file from a running SSH server
-              with the <literal>ssh-keyscan</literal> command.
+              with the <command>ssh-keyscan</command> command.
             '';
           };
         };
diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix
index 1c3dc9d90b1..951cef3eac0 100644
--- a/nixos/modules/services/printing/cupsd.nix
+++ b/nixos/modules/services/printing/cupsd.nix
@@ -49,6 +49,7 @@ in
     services.printing = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable printing support through the CUPS daemon.
@@ -56,6 +57,8 @@ in
       };
 
       bindirCmds = mkOption {
+        type = types.lines;
+        internal = true;
         default = "";
         description = ''
           Additional commands executed while creating the directory
@@ -64,6 +67,7 @@ in
       };
 
       cupsdConf = mkOption {
+        type = types.lines;
         default = "";
         example =
           ''
@@ -77,13 +81,16 @@ in
       };
 
       drivers = mkOption {
-        example = [ pkgs.splix ];
+        type = types.listOf types.path;
+        example = literalExample "[ pkgs.splix ]";
         description = ''
-          CUPS drivers (CUPS, gs and samba are added unconditionally).
+          CUPS drivers to use. Drivers provided by CUPS, Ghostscript
+          and Samba are added unconditionally.
         '';
       };
 
       tempDir = mkOption {
+        type = types.path;
         default = "/tmp";
         example = "/tmp/cups";
         description = ''
diff --git a/nixos/modules/services/scheduling/atd.nix b/nixos/modules/services/scheduling/atd.nix
index 8c96252668e..c516c5889f1 100644
--- a/nixos/modules/services/scheduling/atd.nix
+++ b/nixos/modules/services/scheduling/atd.nix
@@ -17,18 +17,21 @@ in
   options = {
 
     services.atd.enable = mkOption {
+      type = types.bool;
       default = false;
       description = ''
-        Whether to enable the `at' daemon, a command scheduler.
+        Whether to enable the <command>at</command> daemon, a command scheduler.
       '';
     };
 
     services.atd.allowEveryone = mkOption {
+      type = types.bool;
       default = false;
       description = ''
-        Whether to make /var/spool/at{jobs,spool} writeable
-        by everyone (and sticky).  This is normally not needed since
-        the `at' commands are setuid/setgid `atd'.
+        Whether to make <filename>/var/spool/at{jobs,spool}</filename>
+        writeable by everyone (and sticky).  This is normally not
+        needed since the <command>at</command> commands are
+        setuid/setgid <literal>atd</literal>.
      '';
     };
 
diff --git a/nixos/modules/services/scheduling/cron.nix b/nixos/modules/services/scheduling/cron.nix
index e14f03fb1e8..44ed1ba5a07 100644
--- a/nixos/modules/services/scheduling/cron.nix
+++ b/nixos/modules/services/scheduling/cron.nix
@@ -11,7 +11,9 @@ let
     ''
       SHELL=${pkgs.bash}/bin/bash
       PATH=${config.system.path}/bin:${config.system.path}/sbin
-      MAILTO="${config.services.cron.mailto}"
+      ${optionalString (config.services.cron.mailto != null) ''
+        MAILTO="${config.services.cron.mailto}"
+      ''}
       NIX_CONF_DIR=/etc/nix
       ${pkgs.lib.concatStrings (map (job: job + "\n") config.services.cron.systemCronJobs)}
     '';
@@ -34,21 +36,25 @@ in
     services.cron = {
 
       enable = mkOption {
+        type = types.bool;
         default = true;
-        description = "Whether to enable the `vixie cron' daemon.";
+        description = "Whether to enable the Vixie cron daemon.";
       };
 
       mailto = mkOption {
-        default = "";
-        description = " The job output will be mailed to this email address. ";
+        type = types.nullOr types.str;
+        default = null;
+        description = "Email address to which job output will be mailed.";
       };
 
       systemCronJobs = mkOption {
+        type = types.listOf types.str;
         default = [];
-        example = [
-          "* * * * *  test   ls -l / > /tmp/cronout 2>&1"
-          "* * * * *  eelco  echo Hello World > /home/eelco/cronout"
-        ];
+        example = literalExample ''
+          [ "* * * * *  test   ls -l / > /tmp/cronout 2>&1"
+            "* * * * *  eelco  echo Hello World > /home/eelco/cronout"
+          ]
+        '';
         description = ''
           A list of Cron jobs to be appended to the system-wide
           crontab.  See the manual page for crontab for the expected
diff --git a/nixos/modules/services/scheduling/fcron.nix b/nixos/modules/services/scheduling/fcron.nix
index 95ff918eb6d..0c0811ca6e0 100644
--- a/nixos/modules/services/scheduling/fcron.nix
+++ b/nixos/modules/services/scheduling/fcron.nix
@@ -6,7 +6,7 @@ let
 
   cfg = config.services.fcron;
 
-  queuelen = if cfg.queuelen == "" then "" else "-q ${toString cfg.queuelen}";
+  queuelen = if cfg.queuelen == null then "" else "-q ${toString cfg.queuelen}";
 
   systemCronJobs =
     ''
@@ -34,33 +34,40 @@ in
     services.fcron = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
-        description = "Whether to enable the `fcron' daemon.";
+        description = "Whether to enable the <command>fcron</command> daemon.";
       };
 
       allow = mkOption {
+        type = types.listOf types.str;
         default = [ "all" ];
         description = ''
-          Users allowed to use fcrontab and fcrondyn (one name per line, "all" for everyone).
+          Users allowed to use fcrontab and fcrondyn (one name per
+          line, <literal>all</literal> for everyone).
         '';
       };
 
       deny = mkOption {
+        type = types.listOf types.str;
         default = [];
         description = "Users forbidden from using fcron.";
       };
 
       maxSerialJobs = mkOption {
+        type = types.int;
         default = 1;
         description = "Maximum number of serial jobs which can run simultaneously.";
       };
 
       queuelen = mkOption {
-        default = "";
-        description = "Number of jobs the serial queue and the lavg queue can contain - empty to net set this number (-q)";
+        type = types.nullOr types.int;
+        default = null;
+        description = "Number of jobs the serial queue and the lavg queue can contain.";
       };
 
       systab = mkOption {
+        type = types.lines;
         default = "";
         description = ''The "system" crontab contents.'';
       };
diff --git a/nixos/modules/services/system/dbus.nix b/nixos/modules/services/system/dbus.nix
index 40d0853d19d..cb5110f6feb 100644
--- a/nixos/modules/services/system/dbus.nix
+++ b/nixos/modules/services/system/dbus.nix
@@ -77,6 +77,7 @@ in
       };
 
       packages = mkOption {
+        type = types.listOf types.path;
         default = [];
         description = ''
           Packages whose D-Bus configuration files should be included in
diff --git a/nixos/modules/services/system/nscd.nix b/nixos/modules/services/system/nscd.nix
index e8534b12043..b817b1df779 100644
--- a/nixos/modules/services/system/nscd.nix
+++ b/nixos/modules/services/system/nscd.nix
@@ -19,6 +19,7 @@ in
     services.nscd = {
 
       enable = mkOption {
+        type = types.bool;
         default = true;
         description = "Whether to enable the Name Service Cache Daemon.";
       };
diff --git a/nixos/modules/services/ttys/agetty.nix b/nixos/modules/services/ttys/agetty.nix
index 850f558e4cb..ae4fa87d4b7 100644
--- a/nixos/modules/services/ttys/agetty.nix
+++ b/nixos/modules/services/ttys/agetty.nix
@@ -11,6 +11,7 @@ with pkgs.lib;
     services.mingetty = {
 
       greetingLine = mkOption {
+        type = types.str;
         default = ''<<< Welcome to NixOS ${config.system.nixosVersion} (\m) - \l >>>'';
         description = ''
           Welcome line printed by mingetty.
@@ -18,6 +19,7 @@ with pkgs.lib;
       };
 
       helpLine = mkOption {
+        type = types.lines;
         default = "";
         description = ''
           Help line printed by mingetty below the welcome line.
diff --git a/nixos/modules/services/ttys/gpm.nix b/nixos/modules/services/ttys/gpm.nix
index 6a425cf327f..74cee67aeae 100644
--- a/nixos/modules/services/ttys/gpm.nix
+++ b/nixos/modules/services/ttys/gpm.nix
@@ -17,6 +17,7 @@ in
     services.gpm = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = ''
           Whether to enable GPM, the General Purpose Mouse daemon,
@@ -25,6 +26,7 @@ in
       };
 
       protocol = mkOption {
+        type = types.str;
         default = "ps/2";
         description = "Mouse protocol to use.";
       };
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 = ''