2022-12-29 15:05:26 +01:00
|
|
|
{ config, ... }:
|
|
|
|
{
|
|
|
|
imports = [ ./uni.nix ];
|
|
|
|
|
2022-12-30 11:02:10 +01:00
|
|
|
sops.secrets = {
|
|
|
|
"wireless-env" = { };
|
|
|
|
"wireguard/dorm/private" = { };
|
|
|
|
"wireguard/dorm/preshared" = { };
|
|
|
|
};
|
2022-12-29 15:05:26 +01:00
|
|
|
networking = {
|
|
|
|
hostName = "thinkpad";
|
2023-01-01 17:31:22 +01:00
|
|
|
firewall.allowedTCPPortRanges = [{ from = 1714; to = 1764; }]; # open ports for kde connect
|
|
|
|
firewall.allowedUDPPortRanges = [{ from = 1714; to = 1764; }];
|
2022-12-29 15:05:26 +01:00
|
|
|
wireless = {
|
|
|
|
enable = true;
|
|
|
|
userControlled.enable = true;
|
|
|
|
environmentFile = config.sops.secrets."wireless-env".path;
|
|
|
|
networks = {
|
|
|
|
"@HOME_SSID@" = {
|
|
|
|
psk = "@HOME_PSK@";
|
|
|
|
authProtocols = [ "WPA-PSK" ];
|
|
|
|
};
|
|
|
|
"@DORM_SSID@" = {
|
|
|
|
psk = "@DORM_PSK@";
|
|
|
|
authProtocols = [ "WPA-PSK" ];
|
2022-12-30 22:44:05 +01:00
|
|
|
extraConfig = "disabled=1";
|
2022-12-29 15:05:26 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-12-30 11:02:10 +01:00
|
|
|
wg-quick.interfaces = {
|
|
|
|
Dorm = {
|
|
|
|
address = [ "10.10.10.3/32" ];
|
2022-12-30 11:08:39 +01:00
|
|
|
privateKeyFile = config.sops.secrets."wireguard/dorm/private".path;
|
2022-12-30 11:02:10 +01:00
|
|
|
listenPort = 51820;
|
|
|
|
dns = [ "192.168.10.1" ];
|
|
|
|
autostart = false;
|
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
publicKey = "vUmworuJFHjB4KUdkucQ+nzqO2ysARLomq4UuK1n430=";
|
2022-12-30 11:08:39 +01:00
|
|
|
presharedKeyFile = config.sops.secrets."wireguard/dorm/preshared".path;
|
2022-12-30 11:02:10 +01:00
|
|
|
allowedIPs = [ "0.0.0.0/0" ];
|
|
|
|
endpoint = "dorm.vpn.rfive.de:51820";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2022-12-29 15:05:26 +01:00
|
|
|
};
|
|
|
|
}
|