nixos-config/modules/system/devices/networking/wireguard/pc/default.nix

23 lines
565 B
Nix
Raw Normal View History

{ config, ... }:
2024-10-09 03:36:08 -04:00
{
2024-10-20 15:39:00 -04:00
networking.firewall = {
allowedUDPPorts = [ 51820 ];
};
networking.wireguard.interfaces = {
"${config.ips.wgInt}" = {
# Define IP of client in per device config
listenPort = 51820;
2024-10-28 23:24:12 -04:00
privateKeyFile = config.age.secrets.wgClientPriv.path;
peers = [
2024-10-20 18:56:59 -04:00
{
2024-10-28 23:24:12 -04:00
publicKey = "OKUH/h6YSURI4vgeTZKQD15QsqaygdbTn1mAWzQp9S0=";
2024-10-20 18:56:59 -04:00
allowedIPs = [ "${config.ips.wgSpan}.0/24" ];
2024-10-28 23:24:12 -04:00
endpoint = "sv.${config.domains.jim1}:51820";
persistentKeepalive = 25;
}
];
};
};
}