tsPeerix: allow opening of ports on multiple interfaces

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

View File

@ -14,6 +14,11 @@ with lib; {
example = "./private_key"; example = "./private_key";
type = lib.types.path; 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; publicKeyFile = ./peerix.pubs;
}; };
}; };
networking.firewall.interfaces = { networking.firewall.interfaces = listToAttrs (flatten (map (i: {
"tailscale0" = { name = i;
value = {
allowedUDPPorts = [ 12304 ]; allowedUDPPorts = [ 12304 ];
allowedTCPPorts = [ 12304 ]; allowedTCPPorts = [ 12304 ];
}; };
}; }) config.tsPeerix.interfaces));
}; };
} }