nixos-config/config/wireguard.nix

29 lines
696 B
Nix
Raw Normal View History

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 = [
# Old infra: ubuntu-4gb-fsn1-1
{
publicKey = "ZtU2iWwVYeGyXC1ak+wFdTuisQNq7gMthYQZaw6InDU=";
endpoint = "23.88.44.119:51820";
allowedIPs = [
2022-01-15 16:56:20 +00:00
"fd00:e621:e621::/64"
];
}
# Old infra: nas
{
2022-01-15 16:57:34 +00:00
publicKey = "X6IOz4q4zfPy34bRhAjsureLc6lLFOSwvyGDfxgp8n4=";
2022-01-15 16:56:20 +00:00
allowedIPs = [
"fd00:e621:e621:2::/64"
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 ];
2022-01-14 14:38:01 +00:00
}