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 `=`.
|
# wpa_supplicant uses `strchr` to seek to the first `=`, so the only forbidden character is `=`.
|
||||||
escapePwdKey = lib.replaceStrings ["="] ["_"];
|
escapePwdKey = lib.replaceStrings ["="] ["_"];
|
||||||
|
|
||||||
privatePriority = 10;
|
|
||||||
limitedPriority = -10;
|
|
||||||
|
|
||||||
fromList = ns: let
|
fromList = ns: let
|
||||||
go = networkArgs @ {
|
go = networkArgs @ {
|
||||||
ssid,
|
ssid,
|
||||||
|
|
@ -73,100 +70,7 @@
|
||||||
in
|
in
|
||||||
lib.mkMerge (map go ns);
|
lib.mkMerge (map go ns);
|
||||||
in
|
in
|
||||||
fromList [
|
fromList (import ./connectivity/networks.nix);
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -216,13 +120,13 @@
|
||||||
(builtins.map (x: builtins.elemAt (lib.splitString " " x) 1)) # remove 0.0.0.0
|
(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.replaceStrings ["\r\n"] ["\n"]) # convert to unix ending just in case
|
||||||
(lib.splitString "\n")
|
(lib.splitString "\n")
|
||||||
(builtins.filter (x: ! (x == "" || lib.hasPrefix "#" x)))
|
(builtins.filter (x: ! (x == "" || lib.hasPrefix "#" x)))
|
||||||
];
|
];
|
||||||
|
|
||||||
combined_lists = ai_list ++ hategroup-list;
|
combined_lists = ai_list ++ hategroup_list;
|
||||||
in
|
in
|
||||||
pkgs.writeText "dnsblocklist" (builtins.concatStringsSep "\n" combined_lists);
|
pkgs.writeText "dnsblocklist" (builtins.concatStringsSep "\n" combined_lists);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
97
nix/configurations/vanadium/nixos/connectivity/networks.nix
Normal file
97
nix/configurations/vanadium/nixos/connectivity/networks.nix
Normal file
|
|
@ -0,0 +1,97 @@
|
||||||
|
let
|
||||||
|
privatePriority = 10;
|
||||||
|
limitedPriority = -10;
|
||||||
|
in [
|
||||||
|
{
|
||||||
|
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="${./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;
|
||||||
|
}
|
||||||
|
]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue