mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 14:39:39 +00:00
networks: fix ordering and add new network
This commit is contained in:
parent
a1dd3560b7
commit
161a228bd5
3 changed files with 32 additions and 21 deletions
|
|
@ -81,6 +81,13 @@ in
|
||||||
hasPassword = true;
|
hasPassword = true;
|
||||||
randomizeMac = true;
|
randomizeMac = true;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
ssid = "LouisaCoffee";
|
||||||
|
bssid = "fa:92:bf:62:7c:19";
|
||||||
|
priority = privatePriority;
|
||||||
|
hasPassword = true;
|
||||||
|
randomizeMac = true;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
ssid = "MetroTaipei x Louisa"; # 大安
|
ssid = "MetroTaipei x Louisa"; # 大安
|
||||||
priority = privatePriority;
|
priority = privatePriority;
|
||||||
|
|
|
||||||
|
|
@ -20,28 +20,32 @@ let
|
||||||
randomizeMac ? false,
|
randomizeMac ? false,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
uniqueKey = "${ssid}${lib.optionalString (bssid != null) bssid}";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
${uniqueKey} # we use a unique key here to make sure no "same ssid different bssid" networks collide in key.
|
${
|
||||||
=
|
# We use a unique key here to make sure no "same ssid different bssid" networks collide in key.
|
||||||
lib.mkMerge [
|
# This is ordered, we still show "null" so that it would come after hex characters [a-z0-9].
|
||||||
(builtins.removeAttrs networkArgs [
|
# The serialization is based on string order.
|
||||||
"hasPassword"
|
"${ssid},${if bssid != null then bssid else "null"}"
|
||||||
"scanOnLowSignal"
|
} =
|
||||||
"randomizeMac"
|
lib.mkMerge [
|
||||||
])
|
(builtins.removeAttrs networkArgs [
|
||||||
(lib.optionalAttrs hasPassword {
|
"hasPassword"
|
||||||
pskRaw = "ext:${escapePwdKey uniqueKey}"; # this implies changing the external password key if you set a bssid!
|
"scanOnLowSignal"
|
||||||
})
|
"randomizeMac"
|
||||||
{
|
])
|
||||||
extraConfig = ''
|
(lib.optionalAttrs hasPassword {
|
||||||
${lib.optionalString scanOnLowSignal "bgscan=\"simple:30:-70:3600\""}
|
pskRaw = "ext:${
|
||||||
${lib.optionalString randomizeMac "mac_addr=1"}
|
# this implies changing the external password key if you set a bssid!
|
||||||
'';
|
escapePwdKey (if bssid == null then ssid else "${ssid},${bssid}")
|
||||||
}
|
}";
|
||||||
];
|
})
|
||||||
|
{
|
||||||
|
extraConfig = ''
|
||||||
|
${lib.optionalString scanOnLowSignal "bgscan=\"simple:30:-70:3600\""}
|
||||||
|
${lib.optionalString randomizeMac "mac_addr=1"}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
ns: lib.mkMerge (map go ns)
|
ns: lib.mkMerge (map go ns)
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue