From 943f161fc54ce4a4ca2411eafc76dab716b03c6d Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Fri, 4 Nov 2016 13:03:18 +0900 Subject: ghost-one module: use enum --- nixos/modules/services/games/ghost-one.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/games/ghost-one.nix b/nixos/modules/services/games/ghost-one.nix index 5762148df2b..71ff6bb2f3f 100644 --- a/nixos/modules/services/games/ghost-one.nix +++ b/nixos/modules/services/games/ghost-one.nix @@ -21,8 +21,7 @@ in language = mkOption { default = "English"; - type = types.addCheck types.str - (lang: elem lang [ "English" "Spanish" "Russian" "Serbian" "Turkish" ]); + type = types.enum [ "English" "Spanish" "Russian" "Serbian" "Turkish" ]; description = "The language of bot messages: English, Spanish, Russian, Serbian or Turkish."; }; -- cgit 1.4.1 From 5a3c2e3db07218957784ec16dcea2c5d75c9337b Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Fri, 4 Nov 2016 13:03:53 +0900 Subject: bitlbee module: use enum --- nixos/modules/services/networking/bitlbee.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/networking/bitlbee.nix b/nixos/modules/services/networking/bitlbee.nix index 5e6847097a9..e72ea20ccce 100644 --- a/nixos/modules/services/networking/bitlbee.nix +++ b/nixos/modules/services/networking/bitlbee.nix @@ -7,11 +7,6 @@ let cfg = config.services.bitlbee; bitlbeeUid = config.ids.uids.bitlbee; - authModeCheck = v: - v == "Open" || - v == "Closed" || - v == "Registered"; - bitlbeeConfig = pkgs.writeText "bitlbee.conf" '' [settings] @@ -67,7 +62,7 @@ in authMode = mkOption { default = "Open"; - type = types.addCheck types.str authModeCheck; + type = types.enum [ "Open" "Closed" "Registered" ]; description = '' The following authentication modes are available: Open -- Accept connections from anyone, use NickServ for user authentication. -- cgit 1.4.1 From 8f8184ece16f54b874996196a15191470ffa3fc1 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Fri, 4 Nov 2016 13:04:17 +0900 Subject: tinc module: use enum --- nixos/modules/services/networking/tinc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/networking/tinc.nix b/nixos/modules/services/networking/tinc.nix index b26d30597b1..f8e68fda7fc 100644 --- a/nixos/modules/services/networking/tinc.nix +++ b/nixos/modules/services/networking/tinc.nix @@ -68,7 +68,7 @@ in interfaceType = mkOption { default = "tun"; - type = types.addCheck types.str (n: n == "tun" || n == "tap"); + type = types.enum [ "tun" "tap" ]; description = '' The type of virtual interface used for the network connection ''; -- cgit 1.4.1 From 797d40767ddb121e49fa0ee2e224c64bdcb376a3 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Fri, 4 Nov 2016 13:04:52 +0900 Subject: fcgiwrap module: use enum --- nixos/modules/services/web-servers/fcgiwrap.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/web-servers/fcgiwrap.nix b/nixos/modules/services/web-servers/fcgiwrap.nix index 2c5e433003c..a64a187255a 100644 --- a/nixos/modules/services/web-servers/fcgiwrap.nix +++ b/nixos/modules/services/web-servers/fcgiwrap.nix @@ -21,7 +21,7 @@ in { }; socketType = mkOption { - type = types.addCheck types.str (t: t == "unix" || t == "tcp" || t == "tcp6"); + type = types.enum [ "unix" "tcp" "tcp6" ]; default = "unix"; description = "Socket type: 'unix', 'tcp' or 'tcp6'."; }; -- cgit 1.4.1 From 80b854739c57debee887aaf4efa9fb113916ae49 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Fri, 4 Nov 2016 13:05:13 +0900 Subject: grub module: use enum --- nixos/modules/system/boot/loader/grub/grub.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index c3be7407d59..17c842ddc53 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -324,8 +324,7 @@ in fsIdentifier = mkOption { default = "uuid"; - type = types.addCheck types.str - (type: type == "uuid" || type == "label" || type == "provided"); + type = types.enum [ "uuid" "label" "provided" ]; description = '' Determines how GRUB will identify devices when generating the configuration file. A value of uuid / label signifies that grub -- cgit 1.4.1 From ffc0e2f4fc63f3a2d028dbd7d981223fb19cbeb4 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Fri, 4 Nov 2016 13:05:44 +0900 Subject: network-interfaces module: use enum --- nixos/modules/tasks/network-interfaces.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos/modules') diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index aae4dc5fdad..1faa8abd5f7 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -245,7 +245,7 @@ let virtualType = mkOption { default = null; - type = types.nullOr (types.addCheck types.str (v: v == "tun" || v == "tap")); + type = with types; nullOr (enum [ "tun" "tap" ]); description = '' The explicit type of interface to create. Accepts tun or tap strings. Also accepts null to implicitly detect the type of device. -- cgit 1.4.1 From 986510de4562c532beb3c9d794f56e2d8015c9fc Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Fri, 4 Nov 2016 13:11:37 +0900 Subject: logcheck module: use enum --- nixos/modules/services/logging/logcheck.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/logging/logcheck.nix b/nixos/modules/services/logging/logcheck.nix index a8a214b2155..27ed5374f56 100644 --- a/nixos/modules/services/logging/logcheck.nix +++ b/nixos/modules/services/logging/logcheck.nix @@ -55,9 +55,9 @@ let levelOption = mkOption { default = "server"; - type = types.str; + type = types.enum [ "workstation" "server" "paranoid" ]; description = '' - Set the logcheck level. Either "workstation", "server", or "paranoid". + Set the logcheck level. ''; }; -- cgit 1.4.1