hostapd module: use enum
This commit is contained in:
parent
9513ab45aa
commit
fb26d561ed
@ -86,7 +86,7 @@ in
|
|||||||
|
|
||||||
hwMode = mkOption {
|
hwMode = mkOption {
|
||||||
default = "g";
|
default = "g";
|
||||||
type = types.string;
|
type = types.enum [ "a" "b" "g" ];
|
||||||
description = ''
|
description = ''
|
||||||
Operation mode.
|
Operation mode.
|
||||||
(a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g).
|
(a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g).
|
||||||
@ -152,9 +152,6 @@ in
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
assertions = [
|
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);
|
{ assertion = (cfg.channel >= 1 && cfg.channel <= 13);
|
||||||
message = "channel must be between 1 and 13";
|
message = "channel must be between 1 and 13";
|
||||||
}];
|
}];
|
||||||
|
Loading…
Reference in New Issue
Block a user