mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
vanadium/connectivity: split network definition into its own file
This commit is contained in:
parent
6c8052427e
commit
2b8b277e6d
3 changed files with 100 additions and 99 deletions
|
|
@ -41,9 +41,6 @@
|
|||
# wpa_supplicant uses `strchr` to seek to the first `=`, so the only forbidden character is `=`.
|
||||
escapePwdKey = lib.replaceStrings ["="] ["_"];
|
||||
|
||||
privatePriority = 10;
|
||||
limitedPriority = -10;
|
||||
|
||||
fromList = ns: let
|
||||
go = networkArgs @ {
|
||||
ssid,
|
||||
|
|
@ -73,100 +70,7 @@
|
|||
in
|
||||
lib.mkMerge (map go ns);
|
||||
in
|
||||
fromList [
|
||||
{
|
||||
ssid = "~";
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
}
|
||||
{
|
||||
ssid = "Pei’s Wifi";
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
}
|
||||
{
|
||||
ssid = "girlypop-net";
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
}
|
||||
|
||||
{
|
||||
ssid = "annapurna";
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
scanOnLowSignal = true;
|
||||
}
|
||||
{
|
||||
ssid = "5526-1"; # TODO: set bssid preference ?
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
scanOnLowSignal = true;
|
||||
}
|
||||
|
||||
{
|
||||
ssid = "eduroam";
|
||||
priority = privatePriority;
|
||||
scanOnLowSignal = true;
|
||||
|
||||
authProtocols = ["WPA-EAP"];
|
||||
auth = ''
|
||||
pairwise=CCMP
|
||||
group=CCMP TKIP
|
||||
eap=PEAP
|
||||
ca_cert="${./certs/universite_de_rennes.pem}"
|
||||
identity="ychiang@etudiant.univ-rennes.fr"
|
||||
altsubject_match="DNS:radius.univ-rennes1.fr;DNS:radius1.univ-rennes1.fr;DNS:radius2.univ-rennes1.fr;DNS:vmradius-psf1.univ-rennes1.fr;DNS:vmradius-psf2.univ-rennes1.fr"
|
||||
phase2="auth=MSCHAPV2"
|
||||
password=ext:EDUROAM
|
||||
anonymous_identity="anonymous@univ-rennes.fr"
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
ssid = "A-WAY";
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
randomizeMac = true;
|
||||
}
|
||||
{
|
||||
ssid = "CAT.jpgcafe";
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
randomizeMac = true;
|
||||
}
|
||||
{
|
||||
ssid = "LOUISA"; # 區公所
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
randomizeMac = true;
|
||||
}
|
||||
{
|
||||
ssid = "LouisaCoffee"; # 七張
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
randomizeMac = true;
|
||||
}
|
||||
{
|
||||
ssid = "MetroTaipei x Louisa"; # 大安
|
||||
priority = privatePriority;
|
||||
hasPassword = true;
|
||||
randomizeMac = true;
|
||||
}
|
||||
|
||||
{ssid = "_SNCF_WIFI_INOUI";}
|
||||
{ssid = "_WIFI_LYRIA";}
|
||||
{ssid = "EurostarTrainsWiFi";}
|
||||
{ssid = "SBB-FREE";}
|
||||
{ssid = "AOT Airport Free Wi-Fi by NT";}
|
||||
{ssid = "NewTaipei";}
|
||||
{ssid = "Fami-WiFi";}
|
||||
|
||||
{
|
||||
ssid = "iPhone de Léana 江";
|
||||
priority = limitedPriority;
|
||||
hasPassword = true;
|
||||
}
|
||||
];
|
||||
fromList (import ./connectivity/networks.nix);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -216,13 +120,13 @@
|
|||
(builtins.map (x: builtins.elemAt (lib.splitString " " x) 1)) # remove 0.0.0.0
|
||||
];
|
||||
|
||||
hategroup-list = lib.pipe (builtins.readFile "${sources.hategroup-blocklist}/blocklist.txt") [
|
||||
hategroup_list = lib.pipe (builtins.readFile "${sources.hategroup-blocklist}/blocklist.txt") [
|
||||
(lib.replaceStrings ["\r\n"] ["\n"]) # convert to unix ending just in case
|
||||
(lib.splitString "\n")
|
||||
(builtins.filter (x: ! (x == "" || lib.hasPrefix "#" x)))
|
||||
];
|
||||
|
||||
combined_lists = ai_list ++ hategroup-list;
|
||||
combined_lists = ai_list ++ hategroup_list;
|
||||
in
|
||||
pkgs.writeText "dnsblocklist" (builtins.concatStringsSep "\n" combined_lists);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue