tsPeerix: allow opening of ports on multiple interfaces

This commit is contained in:
Aaron Bieber 2022-08-31 07:39:07 -06:00
parent fecefcabda
commit a15e742c8d
No known key found for this signature in database

View File

@ -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));
};
}