nixos/networkmanager: fix serializing an invalid wifi.powersave=null
NetworkManager does not define `null` as a valid value for `wifi.powersave`, and while strangely it doesn't seem to report any errors upon encountering it, it's a weird value and shouldn't be here. This is actually very similar to how the module used to work before the refactor in https://github.com/NixOS/nixpkgs/pull/118308 (see this [snippet](https://github.com/NixOS/nixpkgs/pull/118308/files#diff-0a708e7b053cf5df7620b5262936553af2242d2ce9dabde5bbeba221ece0a021L45-L46) from the PR changes).
This commit is contained in:
@@ -684,13 +684,7 @@ in
|
||||
networkmanager.connectionConfig = {
|
||||
"ethernet.cloned-mac-address" = cfg.ethernet.macAddress;
|
||||
"wifi.cloned-mac-address" = cfg.wifi.macAddress;
|
||||
"wifi.powersave" =
|
||||
if cfg.wifi.powersave == null then
|
||||
null
|
||||
else if cfg.wifi.powersave then
|
||||
3
|
||||
else
|
||||
2;
|
||||
"wifi.powersave" = lib.mkIf (cfg.wifi.powersave != null) (if cfg.wifi.powersave then 3 else 2);
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user