Merge pull request #309551 from aca/master

This commit is contained in:
Sandro 2024-06-10 15:48:32 +02:00 committed by GitHub
commit da3214b120
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,12 +61,21 @@ in {
};
extraUpFlags = mkOption {
description = "Extra flags to pass to {command}`tailscale up`.";
description = ''
Extra flags to pass to {command}`tailscale up`. Only applied if `authKeyFile` is specified.";
'';
type = types.listOf types.str;
default = [];
example = ["--ssh"];
};
extraSetFlags = mkOption {
description = "Extra flags to pass to {command}`tailscale set`.";
type = types.listOf types.str;
default = [];
example = ["--advertise-exit-node"];
};
extraDaemonFlags = mkOption {
description = "Extra flags to pass to {command}`tailscaled`.";
type = types.listOf types.str;
@ -120,6 +129,18 @@ in {
'';
};
systemd.services.tailscaled-set = mkIf (cfg.extraSetFlags != []) {
after = ["tailscaled.service"];
wants = ["tailscaled.service"];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
};
script = ''
${cfg.package}/bin/tailscale set ${escapeShellArgs cfg.extraSetFlags}
'';
};
boot.kernel.sysctl = mkIf (cfg.useRoutingFeatures == "server" || cfg.useRoutingFeatures == "both") {
"net.ipv4.conf.all.forwarding" = mkOverride 97 true;
"net.ipv6.conf.all.forwarding" = mkOverride 97 true;