mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
networks: update wpa_supplicant-compat shim
This commit is contained in:
parent
42b32be4a5
commit
88af6454b7
1 changed files with 4 additions and 5 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
#
|
#
|
||||||
# This loads the list of networks as a NixOS wpa_supplicant compatible attrset
|
# This loads the list of networks as a NixOS wpa_supplicant compatible attrset
|
||||||
#
|
#
|
||||||
|
# View the example config
|
||||||
|
# less $(nix-build --no-out-link -E '(import <nixpkgs> {}).wpa_supplicant')/share/doc/wpa_supplicant/wpa_supplicant.conf.example
|
||||||
let
|
let
|
||||||
sources = import ../../npins;
|
sources = import ../../npins;
|
||||||
lib = import (sources.nixpkgs + "/lib");
|
lib = import (sources.nixpkgs + "/lib");
|
||||||
|
|
@ -15,18 +17,16 @@ let
|
||||||
hasPassword ? false,
|
hasPassword ? false,
|
||||||
scanOnLowSignal ? false,
|
scanOnLowSignal ? false,
|
||||||
randomizeMac ? false,
|
randomizeMac ? false,
|
||||||
# TODO: adapt to the 25.11 interface
|
|
||||||
bssid ? null,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
${ssid} = lib.mkMerge [
|
${ssid} = lib.mkMerge [
|
||||||
(builtins.removeAttrs networkArgs [
|
(builtins.removeAttrs networkArgs [
|
||||||
"ssid"
|
# We keep ssid, because it overrides the attrset name ssid
|
||||||
|
# "ssid"
|
||||||
"hasPassword"
|
"hasPassword"
|
||||||
"scanOnLowSignal"
|
"scanOnLowSignal"
|
||||||
"randomizeMac"
|
"randomizeMac"
|
||||||
"bssid"
|
|
||||||
])
|
])
|
||||||
(lib.optionalAttrs hasPassword {
|
(lib.optionalAttrs hasPassword {
|
||||||
pskRaw = "ext:${escapePwdKey ssid}";
|
pskRaw = "ext:${escapePwdKey ssid}";
|
||||||
|
|
@ -35,7 +35,6 @@ let
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
${lib.optionalString scanOnLowSignal "bgscan=\"simple:30:-70:3600\""}
|
${lib.optionalString scanOnLowSignal "bgscan=\"simple:30:-70:3600\""}
|
||||||
${lib.optionalString randomizeMac "mac_addr=1"}
|
${lib.optionalString randomizeMac "mac_addr=1"}
|
||||||
${lib.optionalString (bssid != null) "bssid=\"${bssid}\""}
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue