summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@higgsboson.tk>2017-01-08 17:45:52 +0100
committerGitHub <noreply@github.com>2017-01-08 17:45:52 +0100
commit94c4eab6cca039381044ce7ae29aed175ec8749b (patch)
treef734b8e401cd717294df70dd5ed2e0ad50442a99 /nixos
parentc63ebbaab4574485638da87cdd63f5ff161a28e9 (diff)
parente138d3afdfbbc49fe0c21e0534806b11b700c598 (diff)
downloadnixlib-94c4eab6cca039381044ce7ae29aed175ec8749b.tar
nixlib-94c4eab6cca039381044ce7ae29aed175ec8749b.tar.gz
nixlib-94c4eab6cca039381044ce7ae29aed175ec8749b.tar.bz2
nixlib-94c4eab6cca039381044ce7ae29aed175ec8749b.tar.lz
nixlib-94c4eab6cca039381044ce7ae29aed175ec8749b.tar.xz
nixlib-94c4eab6cca039381044ce7ae29aed175ec8749b.tar.zst
nixlib-94c4eab6cca039381044ce7ae29aed175ec8749b.zip
Merge pull request #21733 from regellosigkeitsaxiom/master
Added option networking.wireless.networks.*.priority
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/wpa_supplicant.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/wpa_supplicant.nix b/nixos/modules/services/networking/wpa_supplicant.nix
index 5657b91c1e72..c91ba91fcb4d 100644
--- a/nixos/modules/services/networking/wpa_supplicant.nix
+++ b/nixos/modules/services/networking/wpa_supplicant.nix
@@ -12,11 +12,13 @@ let
       psk = if networkConfig.psk != null
         then ''"${networkConfig.psk}"''
         else networkConfig.pskRaw;
+      priority = networkConfig.priority;
     in ''
       network={
         ssid="${ssid}"
         ${optionalString (psk != null) ''psk=${psk}''}
         ${optionalString (psk == null) ''key_mgmt=NONE''}
+        ${optionalString (priority != null) ''priority=${toString priority}''}
       }
     '') cfg.networks)}
   '' else "/etc/wpa_supplicant.conf";
@@ -68,6 +70,19 @@ in {
                 Mutually exclusive with <varname>psk</varname>.
               '';
             };
+            priority = mkOption {
+              type = types.nullOr types.int;
+              default = null;
+              description = ''
+                By default, all networks will get same priority group (0). If some of the
+                networks are more desirable, this field can be used to change the order in
+                which wpa_supplicant goes through the networks when selecting a BSS. The
+                priority groups will be iterated in decreasing priority (i.e., the larger the
+                priority value, the sooner the network is matched against the scan results).
+                Within each priority group, networks will be selected based on security
+                policy, signal strength, etc.
+              '';
+            };
           };
         });
         description = ''