nixos-config/config/wireguard/default.nix

33 lines
990 B
Nix
Raw Normal View History

2022-06-12 15:39:15 +00:00
{config, ...}: {
2022-01-14 14:38:01 +00:00
networking.wireguard = {
enable = true;
interfaces."wg0" = {
listenPort = 51820;
privateKeyFile = "/run/secrets/network/wireguard/privkey";
2022-01-14 14:47:37 +00:00
peers = [
2022-04-07 13:30:09 +00:00
# nixos-8gb-fsn1-1
2022-01-18 12:54:53 +00:00
{
publicKey = "zQY9cAzbRO/FgV92pda7yk0NJFSXzHfi6+tgRq3g/SY=";
2022-01-18 12:57:22 +00:00
allowedIPs = [
"fd0d:a262:1fa6:e621:b4e1:08ff:e658:6f49/128"
"fd0d:a262:1fa6:e621:b4e1:08ff:e658:6f49/7"
2022-01-18 12:54:53 +00:00
];
endpoint = "138.201.155.128:51820";
persistentKeepalive = 25;
2022-01-18 12:54:53 +00:00
}
{
publicKey = "GHsVg8seCVIMYOidH5+/3EnoXRmi98NXtNTVu+nFcnw=";
allowedIPs = [
"fd0d:a262:1fa6:e621:746d:4523:5c04:1453/128"
"fd0d:a262:1fa6:e621:746d:4523:5c04:1453/7"
];
endpoint = "130.162.60.127:51820";
persistentKeepalive = 25;
}
2022-01-14 14:47:37 +00:00
];
2022-01-14 14:38:01 +00:00
};
};
2022-06-12 15:39:15 +00:00
networking.firewall.allowedUDPPorts = [51820];
sops.secrets."network/wireguard/privkey" = {};
2022-01-14 14:38:01 +00:00
}