hostapd module: use enum

Changed files
+1 -4
nixos
modules
services
networking
+1 -4
nixos/modules/services/networking/hostapd.nix
···
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).
···
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";
}];