summary refs log tree commit diff
path: root/nixos/modules/services/networking/hostapd.nix
diff options
context:
space:
mode:
authorFélix Baylac-Jacqué <felix@alternativebit.fr>2019-06-23 21:33:14 +0200
committerFélix Baylac-Jacqué <felix@alternativebit.fr>2019-06-24 00:26:20 +0200
commit98deb873545deae4f475c3f54451cda0693c29e1 (patch)
tree0c77f2bd8ea2d006e82fe0fffaf83256a1c7edd0 /nixos/modules/services/networking/hostapd.nix
parent8fb630b26c74d682e4002d946cc39db9b496d034 (diff)
downloadnixpkgs-98deb873545deae4f475c3f54451cda0693c29e1.tar
nixpkgs-98deb873545deae4f475c3f54451cda0693c29e1.tar.gz
nixpkgs-98deb873545deae4f475c3f54451cda0693c29e1.tar.bz2
nixpkgs-98deb873545deae4f475c3f54451cda0693c29e1.tar.lz
nixpkgs-98deb873545deae4f475c3f54451cda0693c29e1.tar.xz
nixpkgs-98deb873545deae4f475c3f54451cda0693c29e1.tar.zst
nixpkgs-98deb873545deae4f475c3f54451cda0693c29e1.zip
hostapd: Add noscan mode.
Applies OpenWRT's noscan patch to hostapd and the relevant option to
the hostapd module.

This noscan patch adds a new `noscan` option allowing us to create
some overlapping BSSs in HT40+/- mode.

Note: this option is disabled by default, we leave this up to the end
user whether it should be enabled or not.

Not being able to create those overlapping BSSs is basically
preventing us to use 802.11n in any urban area where chances to
overlap with another SSID are extremely high.

The patch we are using is a courtesy of the openwrt team and is
applied to the defaul hostapd package in both OpenWRT and Archlinux.
Diffstat (limited to 'nixos/modules/services/networking/hostapd.nix')
-rw-r--r--nixos/modules/services/networking/hostapd.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix
index 7add48308f8..a3407888496 100644
--- a/nixos/modules/services/networking/hostapd.nix
+++ b/nixos/modules/services/networking/hostapd.nix
@@ -30,10 +30,11 @@ let
     ctrl_interface=/run/hostapd
     ctrl_interface_group=${cfg.group}
 
-    ${if cfg.wpa then ''
+    ${optionalString cfg.wpa ''
       wpa=2
       wpa_passphrase=${cfg.wpaPassphrase}
-      '' else ""}
+    ''}
+    ${optionalString cfg.noScan "noscan=1"}
 
     ${cfg.extraConfig}
   '' ;
@@ -69,6 +70,14 @@ in
         '';
       };
 
+      noScan = mkOption {
+        default = false;
+        description = ''
+          Do not scan for overlapping BSSs in HT40+/- mode.
+          Caution: turning this on will violate regulatory requirements!
+        '';
+      };
+
       driver = mkOption {
         default = "nl80211";
         example = "hostapd";