This commit is contained in:
2023-04-12 20:32:07 +02:00
committed by soraefir
parent 10fbbc2654
commit 8ca1736220
85 changed files with 5217 additions and 4 deletions

45
modules/networking.nix Executable file
View File

@@ -0,0 +1,45 @@
{
config,
...
}:
{
networking = {
hostName = config.hostcfg.hostname;
useDHCP = true;
supplicant = {
"${config.hostcfg.wlp_if}" = {
configFile.path = config.sops.secrets.wifi.path;
extraConf = ''
network={
ssid="test"
psk="12345678"
}
'';
};
};
firewall = {
enable = true;
};
wireguard = {
enable = true;
interfaces = {
wg0 = {
ips = [ config.hostcfg.wg_ip4 config.hostcfg.wg_ip6 ];
privateKeyFile = config.hostcfg.wg_pk;
listenPort = 1515;
peers = [{
allowedIPs = [ "10.10.1.0/24" "fd10:10:10::0/64" ];
endpoint = "vpn.helcel.net:1515";
publicKey = "NFBJvYXZC+bd62jhrKnM7/pugidWhgR6+C5qIiUiq3Q=";
persistentKeepalive = 25;
}];
};
};
};
};
}