Merge pull request #309551 from aca/master
This commit is contained in:
commit
da3214b120
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user