What a clusterfuck

This commit is contained in:
Jimbo 2024-10-09 03:36:08 -04:00
parent 91f88b8bb2
commit f29273be22
221 changed files with 779 additions and 956 deletions

View file

@ -0,0 +1,22 @@
{ 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 = "sv.${outputs.secrets.jimDomain}:51820";
persistentKeepalive = 25;
}
];
};
};
}

View file

@ -0,0 +1,36 @@
{ outputs, ... }:
{
networking = {
nat = {
enable = true;
externalInterface = "${outputs.ips.netInt}";
internalInterfaces = [ "${outputs.ips.wgInt}" ];
};
firewall.allowedUDPPorts = [ 51820 ];
};
networking.wireguard = {
enable = true;
interfaces = {
"${outputs.ips.wgInt}" = {
ips = [ "${outputs.ips.wgSpan}.1/24" ];
listenPort = 51820;
privateKey = outputs.secrets.wgServerPriv;
peers = [
{ # Jimbo Pixel 9
publicKey = outputs.secrets.wgPixel9Pub;
allowedIPs = [ "${outputs.ips.wgSpan}.2/32" ];
}
{ # Oracle VM
publicKey = outputs.secrets.wgOraclePub;
allowedIPs = [ "${outputs.ips.wgSpan}.3/32" ];
}
{ # General Nix
publicKey = outputs.secrets.wgClientPub;
allowedIPs = [ "${outputs.ips.wgSpan}.16/28" ];
}
];
};
};
};
}