git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #20144 from ericsagnes/feat/module-enums
2c567dbJoachim F
nixos/modules/services/games/ghost-one.nix+1−2
@@ -21,8 +21,7 @@ in
21
21
22 language = mkOption {
22 language = mkOption {
23 default = "English";
23 default = "English";
24− type = types.addCheck types.str
25− (lang: elem lang [ "English" "Spanish" "Russian" "Serbian" "Turkish" ]);
24+ type = types.enum [ "English" "Spanish" "Russian" "Serbian" "Turkish" ];
26 description = "The language of bot messages: English, Spanish, Russian, Serbian or Turkish.";
25 description = "The language of bot messages: English, Spanish, Russian, Serbian or Turkish.";
27 };
26 };
28
27
nixos/modules/services/logging/logcheck.nix+2−2
@@ -55,9 +55,9 @@ let
55
55
56 levelOption = mkOption {
56 levelOption = mkOption {
57 default = "server";
57 default = "server";
58− type = types.str;
58+ type = types.enum [ "workstation" "server" "paranoid" ];
59 description = ''
59 description = ''
60− Set the logcheck level. Either "workstation", "server", or "paranoid".
60+ Set the logcheck level.
61 '';
61 '';
62 };
62 };
63
63
nixos/modules/services/networking/bitlbee.nix+1−6
@@ -7,11 +7,6 @@ let
7 cfg = config.services.bitlbee;
7 cfg = config.services.bitlbee;
8 bitlbeeUid = config.ids.uids.bitlbee;
8 bitlbeeUid = config.ids.uids.bitlbee;
9
9
10− authModeCheck = v:
11− v == "Open" ||
12− v == "Closed" ||
13− v == "Registered";
14−
15 bitlbeeConfig = pkgs.writeText "bitlbee.conf"
10 bitlbeeConfig = pkgs.writeText "bitlbee.conf"
16 ''
11 ''
17 [settings]
12 [settings]
@@ -67,7 +62,7 @@ in
67
62
68 authMode = mkOption {
63 authMode = mkOption {
69 default = "Open";
64 default = "Open";
70− type = types.addCheck types.str authModeCheck;
65+ type = types.enum [ "Open" "Closed" "Registered" ];
71 description = ''
66 description = ''
72 The following authentication modes are available:
67 The following authentication modes are available:
73 Open -- Accept connections from anyone, use NickServ for user authentication.
68 Open -- Accept connections from anyone, use NickServ for user authentication.
nixos/modules/services/networking/tinc.nix+1−1
@@ -68,7 +68,7 @@ in
68
68
69 interfaceType = mkOption {
69 interfaceType = mkOption {
70 default = "tun";
70 default = "tun";
71− type = types.addCheck types.str (n: n == "tun" || n == "tap");
71+ type = types.enum [ "tun" "tap" ];
72 description = ''
72 description = ''
73 The type of virtual interface used for the network connection
73 The type of virtual interface used for the network connection
74 '';
74 '';
nixos/modules/services/web-servers/fcgiwrap.nix+1−1
@@ -21,7 +21,7 @@ in {
21 };
21 };
22
22
23 socketType = mkOption {
23 socketType = mkOption {
24− type = types.addCheck types.str (t: t == "unix" || t == "tcp" || t == "tcp6");
24+ type = types.enum [ "unix" "tcp" "tcp6" ];
25 default = "unix";
25 default = "unix";
26 description = "Socket type: 'unix', 'tcp' or 'tcp6'.";
26 description = "Socket type: 'unix', 'tcp' or 'tcp6'.";
27 };
27 };
nixos/modules/system/boot/loader/grub/grub.nix+1−2
@@ -324,8 +324,7 @@ in
324
324
325 fsIdentifier = mkOption {
325 fsIdentifier = mkOption {
326 default = "uuid";
326 default = "uuid";
327− type = types.addCheck types.str
328− (type: type == "uuid" || type == "label" || type == "provided");
327+ type = types.enum [ "uuid" "label" "provided" ];
329 description = ''
328 description = ''
330 Determines how GRUB will identify devices when generating the
329 Determines how GRUB will identify devices when generating the
331 configuration file. A value of uuid / label signifies that grub
330 configuration file. A value of uuid / label signifies that grub
nixos/modules/tasks/network-interfaces.nix+1−1
@@ -245,7 +245,7 @@ let
245
245
246 virtualType = mkOption {
246 virtualType = mkOption {
247 default = null;
247 default = null;
248− type = types.nullOr (types.addCheck types.str (v: v == "tun" || v == "tap"));
248+ type = with types; nullOr (enum [ "tun" "tap" ]);
249 description = ''
249 description = ''
250 The explicit type of interface to create. Accepts tun or tap strings.
250 The explicit type of interface to create. Accepts tun or tap strings.
251 Also accepts null to implicitly detect the type of device.
251 Also accepts null to implicitly detect the type of device.