diff options
-rw-r--r-- | custom/tinc/def.nix | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/custom/tinc/def.nix b/custom/tinc/def.nix index 2cdf1b01..824877a9 100644 --- a/custom/tinc/def.nix +++ b/custom/tinc/def.nix | |||
@@ -140,12 +140,14 @@ in | |||
140 | description = "Tinc Daemon - ${network}"; | 140 | description = "Tinc Daemon - ${network}"; |
141 | wantedBy = [ "network.target" ]; | 141 | wantedBy = [ "network.target" ]; |
142 | after = [ "network-interfaces.target" ]; | 142 | after = [ "network-interfaces.target" ]; |
143 | path = [ data.package ]; | ||
144 | restartTriggers = [ config.environment.etc."tinc/${network}/tinc.conf".source ] | 143 | restartTriggers = [ config.environment.etc."tinc/${network}/tinc.conf".source ] |
145 | ++ mapAttrsToList (host: _ : config.environment.etc."tinc/${network}/hosts/${host}".source) data.hosts; | 144 | ++ mapAttrsToList (host: _ : config.environment.etc."tinc/${network}/hosts/${host}".source) data.hosts; |
146 | serviceConfig = { | 145 | serviceConfig = { |
147 | Type = "forking"; | 146 | Type = "simple"; |
148 | PIDFile = "/run/tinc.${network}.pid"; | 147 | PIDFile = "/run/tinc.${network}.pid"; |
148 | execStart = '' | ||
149 | ${data.package}/bin/tincd -D -L -U tinc.${network} -n ${network} --pidfile /run/tinc.${network}.pid -d ${toString data.debugLevel} | ||
150 | ''; | ||
149 | }; | 151 | }; |
150 | preStart = '' | 152 | preStart = '' |
151 | ${pkgs.openresolv}/bin/resolvconf -d tinc.${network} || true | 153 | ${pkgs.openresolv}/bin/resolvconf -d tinc.${network} || true |
@@ -162,9 +164,6 @@ in | |||
162 | [ -f "/etc/tinc/${network}/rsa_key.priv" ] || tincd -n ${network} -K 4096 | 164 | [ -f "/etc/tinc/${network}/rsa_key.priv" ] || tincd -n ${network} -K 4096 |
163 | fi | 165 | fi |
164 | ''; | 166 | ''; |
165 | script = '' | ||
166 | tincd -L -U tinc.${network} -n ${network} --pidfile /run/tinc.${network}.pid -d ${toString data.debugLevel} | ||
167 | ''; | ||
168 | }) | 167 | }) |
169 | ); | 168 | ); |
170 | 169 | ||