Migrate gateway

This commit is contained in:
soraefir
2026-05-01 17:31:09 +02:00
parent 60bf451310
commit a7ce1dc7ea
12 changed files with 168 additions and 78 deletions

View File

@@ -1,4 +1,5 @@
{ config, lib, ... }: {
imports = [ ./forwarding.nix ];
config = lib.mkIf (config.syscfg.net.wg.enable) {
networking.wireguard = {
enable = true;
@@ -9,12 +10,19 @@
config.sops.secrets."${config.syscfg.hostname}_wg_priv".path;
listenPort = 1515;
mtu = 1340;
peers = [{
allowedIPs = [ "10.10.1.0/24" "fd10:10:10::0/64" ];
endpoint = "vpn.helcel.net:1515";
publicKey = "NFBJvYXZC+bd62jhrKnM7/pugidWhgR6+C5qIiUiq3Q=";
persistentKeepalive = 30;
}];
peers =
if config.syscfg.net.wg.server.enable then
map(secretName:{
allowedIPs = [ "10.10.1.0/24" "fd10:10:10::0/64" ];
publicKey = config.sops.secrets."${secretName}_wg_pub".path;
}) config.syscfg.net.wg.server.peers
else
[{
allowedIPs = [ "10.10.1.0/24" "fd10:10:10::0/64" ];
endpoint = "vpn.helcel.net:1515";
publicKey = "NFBJvYXZC+bd62jhrKnM7/pugidWhgR6+C5qIiUiq3Q=";
persistentKeepalive = 30;
}];
};
};
};