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;
secretsFile = config.age.secrets.wpa_password.path;
networks = let
ordered = nss:
lib.pipe nss [
lib.lists.reverseList
(lib.lists.imap0 (i: lib.mapAttrs (_: n: n // {priority = i;})))
lib.mergeAttrsList
];
orderedByGroups = networkGroups: let
groupsCount = builtins.length networkGroups;
withPriority =
lib.lists.imap0
(i: lib.mapAttrs (_: n: n // {priority = groupsCount - i;}))
networkGroups;
in
lib.mkMerge withPriority;
in
ordered [
# first in list is tried first
{"HiddenParadize@Earth2077".pskRaw = "ext:HOME";}
orderedByGroups [
{
"HiddenParadize@Earth2077".pskRaw = "ext:HOME";
"Peis Wifi".pskRaw = "ext:PEI";
"estrich".pskRaw = "ext:ESTRICH";
"girlypop-net".pskRaw = "ext:MEOW";
"girlypop-net".pskRaw = "ext:GIRLYPOP";
"annapurna".pskRaw = "ext:ANNAPURNA";
"5526-1".pskRaw = "ext:TYLER";
"A-WAY".pskRaw = "ext:AWAYCAFE";
"5526-1".pskRaw = "ext:5526-1";
}
{
"_SNCF_WIFI_INOUI" = {};
"_WIFI_LYRIA" = {};
"EurostarTrainsWiFi" = {};
"SBB-FREE" = {};
"AOT Airport Free Wi-Fi by NT" = {};
}
{
gast-ost.pskRaw = "ext:GAST_OST";
"A-WAY".pskRaw = "ext:A-WAY";
eduroam = {
authProtocols = ["WPA-EAP"];
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.