NixOS-Config/modules/system/devices/networking/wireguard/pc/default.nix

23 lines
572 B
Nix
Raw Normal View History

2024-10-09 03:36:08 -04:00
{ outputs, ... }:
{
networking.firewall = {
allowedUDPPorts = [ 51820 ];
};
networking.wireguard.interfaces = {
2024-09-23 16:36:46 -04:00
"${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" ];
2024-09-25 03:44:06 -04:00
endpoint = "sv.${outputs.secrets.jimDomain}:51820";
persistentKeepalive = 25;
}
];
};
};
}