Merge pull request #102202 from danderson/danderson/post-stop
nixos/tailscale: use upstream systemd service config.
This commit is contained in:
commit
33d8766feb
@ -18,30 +18,10 @@ in {
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment.systemPackages = [ pkgs.tailscale ]; # for the CLI
|
environment.systemPackages = [ pkgs.tailscale ]; # for the CLI
|
||||||
systemd.services.tailscale = {
|
systemd.packages = [ pkgs.tailscale ];
|
||||||
description = "Tailscale client daemon";
|
systemd.services.tailscaled = {
|
||||||
|
|
||||||
after = [ "network-pre.target" ];
|
|
||||||
wants = [ "network-pre.target" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig.Environment = "PORT=${toString cfg.port}";
|
||||||
startLimitIntervalSec = 0;
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart =
|
|
||||||
"${pkgs.tailscale}/bin/tailscaled --port ${toString cfg.port}";
|
|
||||||
|
|
||||||
RuntimeDirectory = "tailscale";
|
|
||||||
RuntimeDirectoryMode = 755;
|
|
||||||
|
|
||||||
StateDirectory = "tailscale";
|
|
||||||
StateDirectoryMode = 750;
|
|
||||||
|
|
||||||
CacheDirectory = "tailscale";
|
|
||||||
CacheDirectoryMode = 750;
|
|
||||||
|
|
||||||
Restart = "on-failure";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,8 @@ buildGoModule rec {
|
|||||||
wrapProgram $out/bin/tailscaled --prefix PATH : ${
|
wrapProgram $out/bin/tailscaled --prefix PATH : ${
|
||||||
lib.makeBinPath [ iproute iptables ]
|
lib.makeBinPath [ iproute iptables ]
|
||||||
}
|
}
|
||||||
|
sed -i -e "s#/usr/sbin#$out/bin#" -e "/^EnvironmentFile/d" ./cmd/tailscaled/tailscaled.service
|
||||||
|
install -D -m0444 -t $out/lib/systemd/system ./cmd/tailscaled/tailscaled.service
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user