mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/zerotierone: simplify the unit
There is no need to stop/start the unit when the machine is online or offline. This should fix the shutdown locking issues. nixos zerotier: sometimes it doesn't shutdown
This commit is contained in:
parent
71c19d3efa
commit
b54c60b689
1 changed files with 7 additions and 3 deletions
|
@ -38,10 +38,13 @@ in
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.services.zerotierone = {
|
systemd.services.zerotierone = {
|
||||||
description = "ZeroTierOne";
|
description = "ZeroTierOne";
|
||||||
path = [ cfg.package ];
|
|
||||||
bindsTo = [ "network-online.target" ];
|
|
||||||
after = [ "network-online.target" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
|
||||||
|
path = [ cfg.package ];
|
||||||
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
mkdir -p /var/lib/zerotier-one/networks.d
|
mkdir -p /var/lib/zerotier-one/networks.d
|
||||||
chmod 700 /var/lib/zerotier-one
|
chmod 700 /var/lib/zerotier-one
|
||||||
|
@ -53,6 +56,7 @@ in
|
||||||
ExecStart = "${cfg.package}/bin/zerotier-one -p${toString cfg.port}";
|
ExecStart = "${cfg.package}/bin/zerotier-one -p${toString cfg.port}";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
KillMode = "process";
|
KillMode = "process";
|
||||||
|
TimeoutStopSec = 5;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue