diff --git a/configs/peerix.nix b/configs/peerix.nix index 0ef5d9b..04a08ab 100644 --- a/configs/peerix.nix +++ b/configs/peerix.nix @@ -14,6 +14,11 @@ with lib; { example = "./private_key"; type = lib.types.path; }; + interfaces = mkOption { + description = "Interfaces to allow peerix to listen on."; + type = types.listOf types.str; + default = [ "tailscale0" ]; + }; }; }; @@ -33,11 +38,12 @@ with lib; { publicKeyFile = ./peerix.pubs; }; }; - networking.firewall.interfaces = { - "tailscale0" = { + networking.firewall.interfaces = listToAttrs (flatten (map (i: { + name = i; + value = { allowedUDPPorts = [ 12304 ]; allowedTCPPorts = [ 12304 ]; }; - }; + }) config.tsPeerix.interfaces)); }; }