cloud: add wg ports automatically
This commit is contained in:
parent
ee7d6d4141
commit
d819ba3e0a
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue