nixos-config/config/wireguard.nix

24 lines
615 B
Nix
Raw Normal View History

2022-01-18 12:54:53 +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 = [
2022-01-18 12:54:53 +00:00
"fd0d:a262:1fa6:e621:b4e1:08ff:e658:6f49/64"
];
endpoint = "138.201.155.128:51820";
persistentKeepalive = 25;
2022-01-18 12:54:53 +00:00
}
2022-01-14 14:47:37 +00:00
];
2022-01-14 14:38:01 +00:00
};
};
2022-01-14 15:52:07 +00:00
networking.firewall.allowedUDPPorts = [ 51820 ];
sops.secrets."network/wireguard/privkey" = { };
2022-01-14 14:38:01 +00:00
}