Maybe unfinished support for wireguard Nix clients

This commit is contained in:
jimjam4real 2024-09-23 13:49:48 -04:00
parent 8a27361843
commit 040d7392dc
5 changed files with 40 additions and 10 deletions

View file

@ -0,0 +1,23 @@
{outputs, ...}: let
ips = import ../modules/ips.nix;
in {
networking.firewall = {
allowedUDPPorts = [ 51820 ];
};
networking.wireguard.interfaces = {
"${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 = "mc.${outputs.secrets.jimDomain}:51820";
persistentKeepalive = 25;
}
];
};
};
}