summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2019-06-25 18:08:58 -0400
committerGitHub <noreply@github.com>2019-06-25 18:08:58 -0400
commit7b8a7cee78468919b98cc4c8694d84165f28ef68 (patch)
tree5a143ce8f99aa085aec92d787b7b96b25eb1fcce /nixos
parent38c28ef10c54bf4899d467854e893842cffb4de6 (diff)
parent5121f8d1e6a82e949563111843c1f577a9ecf9b4 (diff)
downloadnixpkgs-7b8a7cee78468919b98cc4c8694d84165f28ef68.tar
nixpkgs-7b8a7cee78468919b98cc4c8694d84165f28ef68.tar.gz
nixpkgs-7b8a7cee78468919b98cc4c8694d84165f28ef68.tar.bz2
nixpkgs-7b8a7cee78468919b98cc4c8694d84165f28ef68.tar.lz
nixpkgs-7b8a7cee78468919b98cc4c8694d84165f28ef68.tar.xz
nixpkgs-7b8a7cee78468919b98cc4c8694d84165f28ef68.tar.zst
nixpkgs-7b8a7cee78468919b98cc4c8694d84165f28ef68.zip
Merge pull request #63699 from NinjaTrappeur/nin-hostapd-noscan
hostapd: add noscan mode
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/hostapd.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix
index 7add48308f8..54a5bed2563 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";
@@ -162,6 +171,7 @@ in
         after = [ "sys-subsystem-net-devices-${escapedInterface}.device" ];
         bindsTo = [ "sys-subsystem-net-devices-${escapedInterface}.device" ];
         requiredBy = [ "network-link-${cfg.interface}.service" ];
+        wantedBy = [ "multi-user.target" ];
 
         serviceConfig =
           { ExecStart = "${pkgs.hostapd}/bin/hostapd ${configFile}";