This repository has been archived on 2024-10-19. You can view files and clone it, but cannot push or open issues or pull requests.
server-nixos-config/wireguard.nix

22 lines
574 B
Nix
Raw Permalink Normal View History

2024-10-18 22:30:36 -04:00
{outputs, ...}: {
networking.firewall = {
allowedUDPPorts = [ 51820 ];
};
networking.wireguard.interfaces = {
"${outputs.ips.wgInt}" = {
# Define IP of client in per device config
listenPort = 51820;
privateKey = outputs.secrets.wgClientPriv;
peers = [
{ # 0.0.0.0 makes wg act like a traditional VPN
publicKey = outputs.secrets.wgServerPub;
allowedIPs = [ "0.0.0.0/0" ];
endpoint = "other.${outputs.secrets.cornDomain}:51820";
persistentKeepalive = 25;
}
];
};
};
}