diff options
author | Joachim F <joachifm@users.noreply.github.com> | 2016-11-17 22:48:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-17 22:48:26 +0100 |
commit | 2bb30e5d665a75e2adadd88dc214bcad3403799b (patch) | |
tree | eafbb58d88f095edd642b7fb291bdb96da594fb4 /nixos/modules/services | |
parent | ec6e4689ea0014e381abc573d3f64766a54fa0b7 (diff) | |
parent | 0ebc5ec7cb2172063c2e9274327a9a7051641c13 (diff) | |
download | nixlib-2bb30e5d665a75e2adadd88dc214bcad3403799b.tar nixlib-2bb30e5d665a75e2adadd88dc214bcad3403799b.tar.gz nixlib-2bb30e5d665a75e2adadd88dc214bcad3403799b.tar.bz2 nixlib-2bb30e5d665a75e2adadd88dc214bcad3403799b.tar.lz nixlib-2bb30e5d665a75e2adadd88dc214bcad3403799b.tar.xz nixlib-2bb30e5d665a75e2adadd88dc214bcad3403799b.tar.zst nixlib-2bb30e5d665a75e2adadd88dc214bcad3403799b.zip |
Merge pull request #20467 from ericsagnes/feat/module-enums-2
modules: use enum when relevant
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/networking/hostapd.nix | 5 | ||||
-rw-r--r-- | nixos/modules/services/networking/nntp-proxy.nix | 4 | ||||
-rw-r--r-- | nixos/modules/services/networking/nsd.nix | 4 |
3 files changed, 4 insertions, 9 deletions
diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix index 51f95af48029..fd4545e88e2d 100644 --- a/nixos/modules/services/networking/hostapd.nix +++ b/nixos/modules/services/networking/hostapd.nix @@ -86,7 +86,7 @@ in hwMode = mkOption { default = "g"; - type = types.string; + type = types.enum [ "a" "b" "g" ]; description = '' Operation mode. (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g). @@ -152,9 +152,6 @@ in config = mkIf cfg.enable { assertions = [ - { assertion = (cfg.hwMode == "a" || cfg.hwMode == "b" || cfg.hwMode == "g"); - message = "hwMode must be a/b/g"; - } { assertion = (cfg.channel >= 1 && cfg.channel <= 13); message = "channel must be between 1 and 13"; }]; diff --git a/nixos/modules/services/networking/nntp-proxy.nix b/nixos/modules/services/networking/nntp-proxy.nix index dca8ccac7627..7eebecb23b00 100644 --- a/nixos/modules/services/networking/nntp-proxy.nix +++ b/nixos/modules/services/networking/nntp-proxy.nix @@ -148,11 +148,11 @@ in }; verbosity = mkOption { - type = types.str; + type = types.enum [ "error" "warning" "notice" "info" "debug" ]; default = "info"; example = "error"; description = '' - Verbosity level (error, warning, notice, info, debug) + Verbosity level ''; }; diff --git a/nixos/modules/services/networking/nsd.nix b/nixos/modules/services/networking/nsd.nix index ccfd219620cf..481e267f6c38 100644 --- a/nixos/modules/services/networking/nsd.nix +++ b/nixos/modules/services/networking/nsd.nix @@ -345,12 +345,10 @@ let }; rrlWhitelist = mkOption { - type = types.listOf types.str; + type = with types; listOf (enum [ "nxdomain" "error" "referral" "any" "rrsig" "wildcard" "nodata" "dnskey" "positive" "all" ]); default = []; description = '' Whitelists the given rrl-types. - The RRL classification types are: nxdomain, error, referral, any, - rrsig, wildcard, nodata, dnskey, positive, all ''; }; |