summary refs log tree commit diff
path: root/nixos/modules/services/networking/hostapd.nix
diff options
context:
space:
mode:
authorEric Sagnes <eric.sagnes@gmail.com>2016-11-16 22:36:26 +0900
committerEric Sagnes <eric.sagnes@gmail.com>2016-11-16 22:36:26 +0900
commitfb26d561ed47be24d1288599f4579a4f5c0f360d (patch)
tree77e272c92fea6077b055ffa1daa4d988f02d606e /nixos/modules/services/networking/hostapd.nix
parent9513ab45aa6fb06423df1968150bbee9eb821214 (diff)
downloadnixpkgs-fb26d561ed47be24d1288599f4579a4f5c0f360d.tar
nixpkgs-fb26d561ed47be24d1288599f4579a4f5c0f360d.tar.gz
nixpkgs-fb26d561ed47be24d1288599f4579a4f5c0f360d.tar.bz2
nixpkgs-fb26d561ed47be24d1288599f4579a4f5c0f360d.tar.lz
nixpkgs-fb26d561ed47be24d1288599f4579a4f5c0f360d.tar.xz
nixpkgs-fb26d561ed47be24d1288599f4579a4f5c0f360d.tar.zst
nixpkgs-fb26d561ed47be24d1288599f4579a4f5c0f360d.zip
hostapd module: use enum
Diffstat (limited to 'nixos/modules/services/networking/hostapd.nix')
-rw-r--r--nixos/modules/services/networking/hostapd.nix5
1 files changed, 1 insertions, 4 deletions
diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix
index 51f95af4802..fd4545e88e2 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";
       }];