vanadium: refactor network configuration

This commit is contained in:
Primrose 2025-09-04 14:23:37 +08:00
parent 34f97ac266
commit 6e226de54c
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 23 additions and 22 deletions

View file

@ -31,33 +31,25 @@
userControlled.enable = true; userControlled.enable = true;
secretsFile = config.age.secrets.wpa_password.path; secretsFile = config.age.secrets.wpa_password.path;
networks = let networks = let
ordered = nss: orderedByGroups = networkGroups: let
lib.pipe nss [ groupsCount = builtins.length networkGroups;
lib.lists.reverseList withPriority =
(lib.lists.imap0 (i: lib.mapAttrs (_: n: n // {priority = i;}))) lib.lists.imap0
lib.mergeAttrsList (i: lib.mapAttrs (_: n: n // {priority = groupsCount - i;}))
]; networkGroups;
in
lib.mkMerge withPriority;
in in
ordered [ orderedByGroups [
# first in list is tried first
{"HiddenParadize@Earth2077".pskRaw = "ext:HOME";}
{ {
"HiddenParadize@Earth2077".pskRaw = "ext:HOME";
"Peis Wifi".pskRaw = "ext:PEI"; "Peis Wifi".pskRaw = "ext:PEI";
"estrich".pskRaw = "ext:ESTRICH"; "girlypop-net".pskRaw = "ext:GIRLYPOP";
"girlypop-net".pskRaw = "ext:MEOW";
"annapurna".pskRaw = "ext:ANNAPURNA"; "annapurna".pskRaw = "ext:ANNAPURNA";
"5526-1".pskRaw = "ext:TYLER"; "5526-1".pskRaw = "ext:5526-1";
"A-WAY".pskRaw = "ext:AWAYCAFE";
} }
{ {
"_SNCF_WIFI_INOUI" = {}; "A-WAY".pskRaw = "ext:A-WAY";
"_WIFI_LYRIA" = {};
"EurostarTrainsWiFi" = {};
"SBB-FREE" = {};
"AOT Airport Free Wi-Fi by NT" = {};
}
{
gast-ost.pskRaw = "ext:GAST_OST";
eduroam = { eduroam = {
authProtocols = ["WPA-EAP"]; authProtocols = ["WPA-EAP"];
auth = '' auth = ''
@ -73,7 +65,16 @@
''; '';
}; };
} }
{"iPhone de Léana ".pskRaw = "ext:PHONE";} {
"_SNCF_WIFI_INOUI" = {};
"_WIFI_LYRIA" = {};
"EurostarTrainsWiFi" = {};
"SBB-FREE" = {};
"AOT Airport Free Wi-Fi by NT" = {};
}
{
"iPhone de Léana ".pskRaw = "ext:PHONE";
}
]; ];
}; };
}; };

Binary file not shown.