nixos-infra/services/coturn/firewall.nix
2026-04-01 09:54:15 +03:00

34 lines
537 B
Nix

{
config,
lib,
...
}:
let
cfg = config.machine.coturn;
in
with lib;
mkIf cfg.enable {
networking.firewall = {
interfaces.enp2s0 =
let
range = with config.services.coturn; [
{
from = min-port;
to = max-port;
}
];
in
{
allowedUDPPortRanges = range;
allowedUDPPorts = [
3478
5349
];
allowedTCPPortRanges = [ ];
allowedTCPPorts = [
3478
5349
];
};
};
}