summary refs log tree commit diff
path: root/nixos/modules/config
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/modules/config
parent33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004 (diff)
downloadnixpkgs-6eadb16022b6e52f3cdb2167aaa7b82e221bfc1a.tar
nixpkgs-6eadb16022b6e52f3cdb2167aaa7b82e221bfc1a.tar.gz
nixpkgs-6eadb16022b6e52f3cdb2167aaa7b82e221bfc1a.tar.bz2
nixpkgs-6eadb16022b6e52f3cdb2167aaa7b82e221bfc1a.tar.lz
nixpkgs-6eadb16022b6e52f3cdb2167aaa7b82e221bfc1a.tar.xz
nixpkgs-6eadb16022b6e52f3cdb2167aaa7b82e221bfc1a.tar.zst
nixpkgs-6eadb16022b6e52f3cdb2167aaa7b82e221bfc1a.zip
nixos: fix some types
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/fonts/fontconfig.nix8
-rw-r--r--nixos/modules/config/ldap.nix10
2 files changed, 7 insertions, 11 deletions
diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix
index 922a9cf961d..be6662decea 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 1a01533c585..c87996df885 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).