2024-10-15 17:46:44 -04:00
|
|
|
{ config, ... }:
|
2024-10-09 03:36:08 -04:00
|
|
|
{
|
2024-09-07 00:38:19 -04:00
|
|
|
networking = {
|
|
|
|
nat = {
|
|
|
|
enable = true;
|
2024-10-15 17:46:44 -04:00
|
|
|
externalInterface = "${config.ips.netInt}";
|
|
|
|
internalInterfaces = [ "${config.ips.wgInt}" ];
|
2024-09-07 00:38:19 -04:00
|
|
|
};
|
2024-11-02 17:19:40 -04:00
|
|
|
|
2024-09-07 00:38:19 -04:00
|
|
|
firewall.allowedUDPPorts = [ 51820 ];
|
2024-09-06 01:18:21 -04:00
|
|
|
|
2024-11-02 17:19:40 -04:00
|
|
|
wireguard.interfaces = {
|
2024-10-15 17:46:44 -04:00
|
|
|
"${config.ips.wgInt}" = {
|
|
|
|
ips = [ "${config.ips.wgSpan}.1/24" ];
|
2024-09-06 01:18:21 -04:00
|
|
|
listenPort = 51820;
|
2024-10-15 17:46:44 -04:00
|
|
|
privateKey = config.secrets.wgServerPriv;
|
2024-09-06 01:18:21 -04:00
|
|
|
peers = [
|
2024-10-29 01:07:07 -04:00
|
|
|
{ # NixOS
|
|
|
|
publicKey = "OKUH/h6YSURI4vgeTZKQD15QsqaygdbTn1mAWzQp9S0=";
|
2024-10-15 17:46:44 -04:00
|
|
|
allowedIPs = [ "${config.ips.wgSpan}.16/28" ];
|
2024-09-23 13:49:48 -04:00
|
|
|
}
|
2024-10-29 01:07:07 -04:00
|
|
|
{ # Pixel 9
|
|
|
|
publicKey = "dPCtjm67adMZCnyL1O2L+uUOk0RbjA9T/tht1r+qcE4=";
|
|
|
|
allowedIPs = [ "${config.ips.wgSpan}.2/32" ];
|
|
|
|
}
|
2024-09-06 01:18:21 -04:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|