about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2015-08-17 17:52:45 +0000
committerJan Malakhovski <oxij@oxij.org>2015-09-18 18:48:50 +0000
commit6eadb16022b6e52f3cdb2167aaa7b82e221bfc1a (patch)
tree55e2983e16662e1074e9e668998253d31b429d59 /nixos
parent33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004 (diff)
nixos: fix some types
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/config/fonts/fontconfig.nix8
-rw-r--r--nixos/modules/config/ldap.nix10
-rw-r--r--nixos/modules/programs/venus.nix14
-rw-r--r--nixos/modules/programs/wvdial.nix4
-rw-r--r--nixos/modules/programs/xfs_quota.nix8
-rw-r--r--nixos/modules/security/pam.nix2
-rw-r--r--nixos/modules/security/prey.nix4
-rw-r--r--nixos/modules/services/monitoring/smartd.nix4
-rw-r--r--nixos/modules/system/boot/loader/efi.nix2
-rw-r--r--nixos/modules/system/boot/luksroot.nix16
-rw-r--r--nixos/modules/tasks/encrypted-devices.nix6
-rw-r--r--nixos/modules/tasks/filesystems.nix4
-rw-r--r--nixos/modules/tasks/network-interfaces.nix4
-rw-r--r--nixos/modules/virtualisation/containers.nix4
-rw-r--r--nixos/modules/virtualisation/docker.nix2
15 files changed, 44 insertions, 48 deletions
diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix
index 922a9cf961df0..be6662decea6e 100644
--- a/nixos/modules/config/fonts/fontconfig.nix
+++ b/nixos/modules/config/fonts/fontconfig.nix
@@ -108,10 +108,8 @@ with lib;
         subpixel = {
 
           rgba = mkOption {
-            type = types.string // {
-              check = flip elem ["rgb" "bgr" "vrgb" "vbgr" "none"];
-            };
             default = "rgb";
+            type = types.enum ["rgb" "bgr" "vrgb" "vbgr" "none"];
             description = ''
               Subpixel order, one of <literal>none</literal>,
               <literal>rgb</literal>, <literal>bgr</literal>,
@@ -120,10 +118,8 @@ with lib;
           };
 
           lcdfilter = mkOption {
-            type = types.str // {
-              check = flip elem ["none" "default" "light" "legacy"];
-            };
             default = "default";
+            type = types.enum ["none" "default" "light" "legacy"];
             description = ''
               FreeType LCD filter, one of <literal>none</literal>,
               <literal>default</literal>, <literal>light</literal>, or
diff --git a/nixos/modules/config/ldap.nix b/nixos/modules/config/ldap.nix
index 1a01533c585b1..c87996df8855b 100644
--- a/nixos/modules/config/ldap.nix
+++ b/nixos/modules/config/ldap.nix
@@ -108,7 +108,7 @@ in
 
         extraConfig = mkOption {
           default =  "";
-          type = types.string;
+          type = types.lines;
           description = ''
             Extra configuration options that will be added verbatim at
             the end of the nslcd configuration file (nslcd.conf).
@@ -120,7 +120,7 @@ in
         distinguishedName = mkOption {
           default = "";
           example = "cn=admin,dc=example,dc=com";
-          type = types.string;
+          type = types.str;
           description = ''
             The distinguished name to bind to the LDAP server with. If this
             is not specified, an anonymous bind will be done.
@@ -129,7 +129,7 @@ in
 
         password = mkOption {
           default = "/etc/ldap/bind.password";
-          type = types.string;
+          type = types.str;
           description = ''
             The path to a file containing the credentials to use when binding
             to the LDAP server (if not binding anonymously).
@@ -149,7 +149,7 @@ in
 
         policy = mkOption {
           default = "hard_open";
-          type = types.string;
+          type = types.enum [ "hard_open" "hard_init" "soft" ];
           description = ''
             Specifies the policy to use for reconnecting to an unavailable
             LDAP server. The default is <literal>hard_open</literal>, which
@@ -168,7 +168,7 @@ in
 
       extraConfig = mkOption {
         default = "";
-        type = types.string;
+        type = types.lines;
         description = ''
           Extra configuration options that will be added verbatim at
           the end of the ldap configuration file (ldap.conf).
diff --git a/nixos/modules/programs/venus.nix b/nixos/modules/programs/venus.nix
index 3b5ae07e82f7c..ca3188b181994 100644
--- a/nixos/modules/programs/venus.nix
+++ b/nixos/modules/programs/venus.nix
@@ -41,7 +41,7 @@ in
 
       dates = mkOption {
         default = "*:0/15";
-        type = types.string;
+        type = types.str;
         description = ''
           Specification (in the format described by
           <citerefentry><refentrytitle>systemd.time</refentrytitle>
@@ -52,7 +52,7 @@ in
 
       user = mkOption {
         default = "root";
-        type = types.string;
+        type = types.str;
         description = ''
           User for running venus script.
         '';
@@ -60,7 +60,7 @@ in
 
       group = mkOption {
         default = "root";
-        type = types.string;
+        type = types.str;
         description = ''
           Group for running venus script.
         '';
@@ -68,7 +68,7 @@ in
 
       name = mkOption {
         default = "NixOS Planet";
-        type = types.string;
+        type = types.str;
         description = ''
           Your planet's name.
         '';
@@ -76,7 +76,7 @@ in
 
       link = mkOption {
         default = "http://planet.nixos.org";
-        type = types.string;
+        type = types.str;
         description = ''
           Link to the main page.
         '';
@@ -84,7 +84,7 @@ in
 
       ownerName = mkOption {
         default = "Rok Garbas";
-        type = types.string;
+        type = types.str;
         description = ''
           Your name.
         '';
@@ -92,7 +92,7 @@ in
 
       ownerEmail = mkOption {
         default = "some@example.com";
-        type = types.string;
+        type = types.str;
         description = ''
           Your e-mail address.
         '';
diff --git a/nixos/modules/programs/wvdial.nix b/nixos/modules/programs/wvdial.nix
index 8e7d0e51a4e09..1ed929ed4afa2 100644
--- a/nixos/modules/programs/wvdial.nix
+++ b/nixos/modules/programs/wvdial.nix
@@ -24,7 +24,7 @@ in
 
       dialerDefaults = mkOption {
         default = "";
-        type = types.string;
+        type = types.str;
         example = ''Init1 = AT+CGDCONT=1,"IP","internet.t-mobile"'';
         description = ''
           Contents of the "Dialer Defaults" section of
@@ -40,7 +40,7 @@ in
           persist
           noauth
         '';
-        type = types.string;
+        type = types.str;
         description = "Default ppp settings for wvdial.";
       };
 
diff --git a/nixos/modules/programs/xfs_quota.nix b/nixos/modules/programs/xfs_quota.nix
index d30a85922cff2..90b6304fa9990 100644
--- a/nixos/modules/programs/xfs_quota.nix
+++ b/nixos/modules/programs/xfs_quota.nix
@@ -32,25 +32,25 @@ in
             };
 
             fileSystem = mkOption {
-              type = types.string;
+              type = types.str;
               description = "XFS filesystem hosting the xfs_quota project.";
               default = "/";
             };
 
             path = mkOption {
-              type = types.string;
+              type = types.str;
               description = "Project directory.";
             };
 
             sizeSoftLimit = mkOption {
-              type = types.nullOr types.string;
+              type = types.nullOr types.str;
               default = null;
               example = "30g";
               description = "Soft limit of the project size";
             };
 
             sizeHardLimit = mkOption {
-              type = types.nullOr types.string;
+              type = types.nullOr types.str;
               default = null;
               example = "50g";
               description = "Hard limit of the project size.";
diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix
index 474b93b4984df..88760574cbc61 100644
--- a/nixos/modules/security/pam.nix
+++ b/nixos/modules/security/pam.nix
@@ -419,7 +419,7 @@ in
     users.motd = mkOption {
       default = null;
       example = "Today is Sweetmorn, the 4th day of The Aftermath in the YOLD 3178.";
-      type = types.nullOr types.string;
+      type = types.nullOr types.lines;
       description = "Message of the day shown to users when they log in.";
     };
 
diff --git a/nixos/modules/security/prey.nix b/nixos/modules/security/prey.nix
index d7d438103a2ca..1c643f2e1a570 100644
--- a/nixos/modules/security/prey.nix
+++ b/nixos/modules/security/prey.nix
@@ -24,7 +24,7 @@ in {
       };
 
       deviceKey = mkOption {
-        type = types.string;
+        type = types.str;
         description = ''
           <literal>Device key</literal> obtained by visiting
           <link xlink:href="https://panel.preyproject.com/devices" />
@@ -33,7 +33,7 @@ in {
       };
 
       apiKey = mkOption {
-        type = types.string;
+        type = types.str;
         description = ''
           <literal>API key</literal> obtained from
           <link xlink:href="https://panel.preyproject.com/profile" />.
diff --git a/nixos/modules/services/monitoring/smartd.nix b/nixos/modules/services/monitoring/smartd.nix
index 61ba16123252b..1017005226b2d 100644
--- a/nixos/modules/services/monitoring/smartd.nix
+++ b/nixos/modules/services/monitoring/smartd.nix
@@ -119,7 +119,7 @@ in
 
           recipient = mkOption {
             default = "root";
-            type = types.string;
+            type = types.str;
             description = "Recipient of the notification messages.";
           };
 
@@ -153,7 +153,7 @@ in
 
           display = mkOption {
             default = ":${toString config.services.xserver.display}";
-            type = types.string;
+            type = types.str;
             description = "DISPLAY to send X11 notifications to.";
           };
         };
diff --git a/nixos/modules/system/boot/loader/efi.nix b/nixos/modules/system/boot/loader/efi.nix
index 241cfc7e836d9..726634e664d71 100644
--- a/nixos/modules/system/boot/loader/efi.nix
+++ b/nixos/modules/system/boot/loader/efi.nix
@@ -15,7 +15,7 @@ with lib;
     efiSysMountPoint = mkOption {
       default = "/boot";
 
-      type = types.string;
+      type = types.str;
 
       description = "Where the EFI System Partition is mounted.";
     };
diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix
index 1b4f0d401e6df..4a14ff1879c97 100644
--- a/nixos/modules/system/boot/luksroot.nix
+++ b/nixos/modules/system/boot/luksroot.nix
@@ -242,20 +242,20 @@ in
 
         name = mkOption {
           example = "luksroot";
-          type = types.string;
+          type = types.str;
           description = "Named to be used for the generated device in /dev/mapper.";
         };
 
         device = mkOption {
           example = "/dev/sda2";
-          type = types.string;
+          type = types.str;
           description = "Path of the underlying block device.";
         };
 
         header = mkOption {
           default = null;
           example = "/root/header.img";
-          type = types.nullOr types.string;
+          type = types.nullOr types.str;
           description = ''
             The name of the file or block device that
             should be used as header for the encrypted device.
@@ -265,7 +265,7 @@ in
         keyFile = mkOption {
           default = null;
           example = "/dev/sdb1";
-          type = types.nullOr types.string;
+          type = types.nullOr types.str;
           description = ''
             The name of the file (can be a raw device or a partition) that
             should be used as the decryption key for the encrypted device. If
@@ -349,7 +349,7 @@ in
 
             ramfsMountPoint = mkOption {
               default = "/crypt-ramfs";
-              type = types.string;
+              type = types.str;
               description = "Path where the ramfs used to update the LUKS key will be mounted during early boot.";
             };
 
@@ -369,19 +369,19 @@ in
 
               fsType = mkOption {
                 default = "vfat";
-                type = types.string;
+                type = types.str;
                 description = "The filesystem of the unencrypted device.";
               };
 
               mountPoint = mkOption {
                 default = "/crypt-storage";
-                type = types.string;
+                type = types.str;
                 description = "Path where the unencrypted device will be mounted during early boot.";
               };
 
               path = mkOption {
                 default = "/crypt-storage/default";
-                type = types.string;
+                type = types.str;
                 description = ''
                   Absolute path of the salt on the unencrypted device with
                   that device's root directory as "/".
diff --git a/nixos/modules/tasks/encrypted-devices.nix b/nixos/modules/tasks/encrypted-devices.nix
index 0370e36fbec2a..8b5dd22fd3801 100644
--- a/nixos/modules/tasks/encrypted-devices.nix
+++ b/nixos/modules/tasks/encrypted-devices.nix
@@ -22,21 +22,21 @@ let
       blkDev = mkOption {
         default = null;
         example = "/dev/sda1";
-        type = types.uniq (types.nullOr types.string);
+        type = types.nullOr types.str;
         description = "Location of the backing encrypted device.";
       };
 
       label = mkOption {
         default = null;
         example = "rootfs";
-        type = types.uniq (types.nullOr types.string);
+        type = types.nullOr types.str;
         description = "Label of the backing encrypted device.";
       };
 
       keyFile = mkOption {
         default = null;
         example = "/root/.swapkey";
-        type = types.uniq (types.nullOr types.string);
+        type = types.nullOr types.str;
         description = "File system location of keyfile.";
       };
     };
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix
index ce21d9fe76218..ce9e3555b6cd3 100644
--- a/nixos/modules/tasks/filesystems.nix
+++ b/nixos/modules/tasks/filesystems.nix
@@ -22,14 +22,14 @@ let
       device = mkOption {
         default = null;
         example = "/dev/sda";
-        type = types.uniq (types.nullOr types.string);
+        type = types.nullOr types.str;
         description = "Location of the device.";
       };
 
       label = mkOption {
         default = null;
         example = "root-partition";
-        type = types.uniq (types.nullOr types.string);
+        type = types.nullOr types.str;
         description = "Label of the device (if any).";
       };
 
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix
index a967fc77e6866..9931c977e8f0c 100644
--- a/nixos/modules/tasks/network-interfaces.nix
+++ b/nixos/modules/tasks/network-interfaces.nix
@@ -499,7 +499,7 @@ in
 
         interface = mkOption {
           example = "enp4s0";
-          type = types.string;
+          type = types.str;
           description = "The interface the macvlan will transmit packets through.";
         };
 
@@ -605,7 +605,7 @@ in
 
         interface = mkOption {
           example = "enp4s0";
-          type = types.string;
+          type = types.str;
           description = "The interface the vlan will transmit packets through.";
         };
 
diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix
index 8d12c5a57fd95..02cf1fe46a557 100644
--- a/nixos/modules/virtualisation/containers.nix
+++ b/nixos/modules/virtualisation/containers.nix
@@ -108,7 +108,7 @@ in
             };
 
             hostAddress = mkOption {
-              type = types.nullOr types.string;
+              type = types.nullOr types.str;
               default = null;
               example = "10.231.136.1";
               description = ''
@@ -117,7 +117,7 @@ in
             };
 
             localAddress = mkOption {
-              type = types.nullOr types.string;
+              type = types.nullOr types.str;
               default = null;
               example = "10.231.136.2";
               description = ''
diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix
index ba078cc0a11f0..0115b972e80d3 100644
--- a/nixos/modules/virtualisation/docker.nix
+++ b/nixos/modules/virtualisation/docker.nix
@@ -67,7 +67,7 @@ in
 
     postStart =
       mkOption {
-        type = types.string;
+        type = types.lines;
         default = ''
           while ! [ -e /var/run/docker.sock ]; do
             sleep 0.1