diff options
| author | Grisha Shipunov | 2025-01-11 18:54:58 +0100 |
|---|---|---|
| committer | Grisha Shipunov | 2025-01-12 13:46:49 +0100 |
| commit | d819ba3e0a13c7aba4a550e2ee2366a847d5016f (patch) | |
| tree | 7dff96637b436579b1c96431d008f8ef4059b080 | |
| parent | ee7d6d41413788d1e69d03c21e494eef5ec028b0 (diff) | |
cloud: add wg ports automatically
| -rw-r--r-- | hosts/cloud/networking.nix | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hosts/cloud/networking.nix b/hosts/cloud/networking.nix index ea37472..71af8e1 100644 --- a/hosts/cloud/networking.nix +++ b/hosts/cloud/networking.nix @@ -1,10 +1,15 @@ -{ lib, ... }: +{ lib, config, ... }: { networking.dhcpcd.enable = false; networking.firewall.enable = true; # TODO: configure automatically in the module - networking.firewall.allowedUDPPorts = [ 51820 ]; + networking.firewall.allowedUDPPorts = + let + wg-nets = lib.filter (net: net.hosts.cloud.endpoint.enable) config.oxalab.wg; + wg-ports = map (net: net.hosts.cloud.endpoint.port) wg-nets; + in + wg-ports; networking.useNetworkd = true; systemd.network.enable = true; |
