cloud: add wg ports automatically

This commit is contained in:
Grisha Shipunov 2025-01-11 18:54:58 +01:00
parent ee7d6d4141
commit d819ba3e0a

View file

@ -1,10 +1,15 @@
{ lib, ... }: { lib, config, ... }:
{ {
networking.dhcpcd.enable = false; networking.dhcpcd.enable = false;
networking.firewall.enable = true; networking.firewall.enable = true;
# TODO: configure automatically in the module # 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; networking.useNetworkd = true;
systemd.network.enable = true; systemd.network.enable = true;