nixos/tailscale: add openFirewall option
This commit is contained in:
parent
5c78e5b4aa
commit
9407ed628d
1 changed files with 8 additions and 0 deletions
|
@ -31,6 +31,12 @@ in {
|
|||
|
||||
package = lib.mkPackageOptionMD pkgs "tailscale" {};
|
||||
|
||||
openFirewall = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
description = lib.mdDoc "Whether to open the firewall for the specified port.";
|
||||
};
|
||||
|
||||
useRoutingFeatures = mkOption {
|
||||
type = types.enum [ "none" "client" "server" "both" ];
|
||||
default = "none";
|
||||
|
@ -113,6 +119,8 @@ in {
|
|||
"net.ipv6.conf.all.forwarding" = mkOverride 97 true;
|
||||
};
|
||||
|
||||
networking.firewall.allowedUDPPorts = mkIf cfg.openFirewall [ cfg.port ];
|
||||
|
||||
networking.firewall.checkReversePath = mkIf (cfg.useRoutingFeatures == "client" || cfg.useRoutingFeatures == "both") "loose";
|
||||
|
||||
networking.dhcpcd.denyInterfaces = [ cfg.interfaceName ];
|
||||
|
|
Loading…
Reference in a new issue