summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2017-11-06 06:17:16 +0000
committerGitHub <noreply@github.com>2017-11-06 06:17:16 +0000
commit30bd9947243818db1924d241f468baac7e90214a (patch)
treee682c5a9d21fd979f0db0c457e68194b453e4774 /nixos
parent9431da53968de8e3a71b0e37dae8416b48ac368d (diff)
parentaf13b05dda7a598c51a81a81b92c36d27e599889 (diff)
downloadnixpkgs-30bd9947243818db1924d241f468baac7e90214a.tar
nixpkgs-30bd9947243818db1924d241f468baac7e90214a.tar.gz
nixpkgs-30bd9947243818db1924d241f468baac7e90214a.tar.bz2
nixpkgs-30bd9947243818db1924d241f468baac7e90214a.tar.lz
nixpkgs-30bd9947243818db1924d241f468baac7e90214a.tar.xz
nixpkgs-30bd9947243818db1924d241f468baac7e90214a.tar.zst
nixpkgs-30bd9947243818db1924d241f468baac7e90214a.zip
Merge pull request #31161 from nocent/master
networkmanager: add power saving and mac address randomization options for wifi devices
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/networkmanager.nix27
1 files changed, 26 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix
index e03309c8729..6bdae32f72b 100644
--- a/nixos/modules/services/networking/networkmanager.nix
+++ b/nixos/modules/services/networking/networkmanager.nix
@@ -32,6 +32,11 @@ let
     ipv6.ip6-privacy=2
     ethernet.cloned-mac-address=${cfg.ethernet.macAddress}
     wifi.cloned-mac-address=${cfg.wifi.macAddress}
+    ${optionalString (cfg.wifi.powersave != null)
+      ''wifi.powersave=${if cfg.wifi.powersave then "3" else "2"}''}
+
+    [device]
+    wifi.scan-rand-mac-address=${if cfg.wifi.scanRandMacAddress then "yes" else "no"}
   '';
 
   /*
@@ -179,7 +184,27 @@ in {
       };
 
       ethernet.macAddress = macAddressOpt;
-      wifi.macAddress = macAddressOpt;
+
+      wifi = {
+        macAddress = macAddressOpt;
+
+        powersave = mkOption {
+          type = types.nullOr types.bool;
+          default = null;
+          description = ''
+            Whether to enable Wi-Fi power saving.
+          '';
+        };
+
+        scanRandMacAddress = mkOption {
+          type = types.bool;
+          default = true;
+          description = ''
+            Whether to enable MAC address randomization of a Wi-Fi device
+            during scanning.
+          '';
+        };
+      };
 
       useDnsmasq = mkOption {
         type = types.bool;