summaryrefslogtreecommitdiff
path: root/hosts/cloud
diff options
context:
space:
mode:
authorGrisha Shipunov2025-01-11 18:54:58 +0100
committerGrisha Shipunov2025-01-12 13:46:49 +0100
commitd819ba3e0a13c7aba4a550e2ee2366a847d5016f (patch)
tree7dff96637b436579b1c96431d008f8ef4059b080 /hosts/cloud
parentee7d6d41413788d1e69d03c21e494eef5ec028b0 (diff)
cloud: add wg ports automatically
Diffstat (limited to 'hosts/cloud')
-rw-r--r--hosts/cloud/networking.nix9
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;