2022-09-27 14:05:24 +02:00
|
|
|
{ ... }:
|
2022-09-26 17:17:27 +02:00
|
|
|
{
|
2022-09-27 14:05:24 +02:00
|
|
|
services.v.dns = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = false;
|
|
|
|
mode = "laptop";
|
|
|
|
};
|
2022-09-26 17:17:27 +02:00
|
|
|
networking = {
|
2022-09-27 14:05:24 +02:00
|
|
|
useDHCP = true;
|
2022-09-28 12:20:54 +02:00
|
|
|
dhcpcd.wait = "background";
|
2022-09-26 17:17:27 +02:00
|
|
|
wireless = {
|
|
|
|
enable = true;
|
|
|
|
environmentFile = "/var/lib/secrets/wireless.env";
|
|
|
|
userControlled.enable = true;
|
|
|
|
networks = {
|
|
|
|
eduroam = {
|
|
|
|
auth = ''
|
|
|
|
proto=RSN
|
|
|
|
key_mgmt=WPA-EAP
|
|
|
|
eap=PEAP
|
|
|
|
identity="vroest@tudelft.nl"
|
|
|
|
password=hash:@EDUROAM_PASSWORD_HASH@
|
|
|
|
domain_suffix_match="radius.tudelft.nl"
|
|
|
|
anonymous_identity="anonymous@tudelft.nl"
|
|
|
|
phase1="peaplabel=0"
|
|
|
|
phase2="auth=MSCHAPV2"
|
|
|
|
ca_cert="/etc/ssl/certs/ca-bundle.crt"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
"Pikachu 5G" = {
|
|
|
|
psk = "@PIKACHU_PASSWORD@";
|
|
|
|
};
|
2022-10-03 10:44:16 +02:00
|
|
|
"sha256('yeet')" = {
|
|
|
|
psk = "@SHA256_PASSWORD@";
|
|
|
|
};
|
2022-10-06 11:54:43 +02:00
|
|
|
"wired" = {
|
|
|
|
psk = "@WIRED_PASSWORD@";
|
|
|
|
};
|
2022-09-26 17:17:27 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-26 23:51:00 +02:00
|
|
|
nameservers = [
|
2022-09-27 17:36:46 +02:00
|
|
|
"127.0.0.1" # Use locally deployed unbound
|
|
|
|
"::1"
|
2022-09-26 23:51:00 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
firewall.allowedUDPPorts = [ 51820 ];
|
|
|
|
|
|
|
|
# Maybe switch to wg-quick
|
|
|
|
wireguard.interfaces.wg0 = {
|
|
|
|
ips = [ "10.100.0.4/24" ];
|
|
|
|
listenPort = 51820;
|
|
|
|
privateKeyFile = "/var/lib/secrets/wg_key";
|
|
|
|
|
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
# Delft
|
|
|
|
publicKey = "kDIO3BJSYlDwRXc2zt9tR1LqKJzIPrulaRmdiYkg+m0=";
|
|
|
|
allowedIPs = [ "10.100.0.1" "10.42.42.0/23" ];
|
2022-09-27 14:05:24 +02:00
|
|
|
endpoint = "195.85.167.34:51820";
|
2022-09-26 23:51:00 +02:00
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
# Aerdenhout
|
|
|
|
publicKey = "KgqLhmUMX6kyTjRoa/GOCrZOvXNE5HWYuOr/T3v8/VI=";
|
|
|
|
allowedIPs = [
|
|
|
|
"10.100.0.5"
|
|
|
|
"192.168.0.0/24" # to avoid being less specific than a LAN
|
|
|
|
"192.168.1.0/24"
|
|
|
|
"10.10.10.0/24"
|
|
|
|
];
|
2022-09-27 14:05:24 +02:00
|
|
|
endpoint = "80.60.83.220:51820";
|
2022-09-26 23:51:00 +02:00
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2022-09-26 17:17:27 +02:00
|
|
|
};
|
|
|
|
}
|