diff options
-rw-r--r-- | custom/tinc/def.nix | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/custom/tinc/def.nix b/custom/tinc/def.nix index bbf9f483..0129f251 100644 --- a/custom/tinc/def.nix +++ b/custom/tinc/def.nix | |||
@@ -165,12 +165,10 @@ in | |||
165 | after = [ "network-interfaces.target" ]; | 165 | after = [ "network-interfaces.target" ]; |
166 | restartTriggers = [ config.environment.etc."tinc/${network}/tinc.conf".source ] | 166 | restartTriggers = [ config.environment.etc."tinc/${network}/tinc.conf".source ] |
167 | ++ mapAttrsToList (host: _ : config.environment.etc."tinc/${network}/hosts/${host}".source) data.hosts; | 167 | ++ mapAttrsToList (host: _ : config.environment.etc."tinc/${network}/hosts/${host}".source) data.hosts; |
168 | path = [ data.package ]; | ||
168 | serviceConfig = { | 169 | serviceConfig = { |
169 | Type = "simple"; | 170 | Type = "simple"; |
170 | PIDFile = "/run/tinc.${network}.pid"; | 171 | PIDFile = "/run/tinc.${network}.pid"; |
171 | ExecStartPre = '' | ||
172 | ${data.package}/bin/tinc -n ${network} --pidfile /run/tinc.${network}.pid --batch fsck | ||
173 | ''; | ||
174 | ExecStart = '' | 172 | ExecStart = '' |
175 | ${data.package}/bin/tincd -D -U tinc.${network} -n ${network} --pidfile /run/tinc.${network}.pid -d ${toString data.debugLevel} | 173 | ${data.package}/bin/tincd -D -U tinc.${network} -n ${network} --pidfile /run/tinc.${network}.pid -d ${toString data.debugLevel} |
176 | ''; | 174 | ''; |
@@ -181,12 +179,14 @@ in | |||
181 | # Determine how we should generate our keys | 179 | # Determine how we should generate our keys |
182 | if type tinc >/dev/null 2>&1; then | 180 | if type tinc >/dev/null 2>&1; then |
183 | # Tinc 1.1+ uses the tinc helper application for key generation | 181 | # Tinc 1.1+ uses the tinc helper application for key generation |
184 | [ -f "/etc/tinc/${network}/ed25519_key.priv" ] || tinc -n ${network} generate-ed25519-keys | 182 | [ -f "/etc/tinc/${network}/ed25519_key.priv" ] || tinc -n ${network} --pidfile /run/tinc.${network}.pid generate-ed25519-keys |
185 | [ -f "/etc/tinc/${network}/rsa_key.priv" ] || tinc -n ${network} generate-rsa-keys 4096 | 183 | [ -f "/etc/tinc/${network}/rsa_key.priv" ] || tinc -n ${network} --pidfile /run/tinc.${network}.pid generate-rsa-keys 4096 |
186 | else | 184 | else |
187 | # Tinc 1.0 uses the tincd application | 185 | # Tinc 1.0 uses the tincd application |
188 | [ -f "/etc/tinc/${network}/rsa_key.priv" ] || tincd -n ${network} -K 4096 | 186 | [ -f "/etc/tinc/${network}/rsa_key.priv" ] || tincd -n ${network} -K 4096 |
189 | fi | 187 | fi |
188 | |||
189 | tinc -n ${network} --pidfile /run/tinc.${network}.pid --batch fsck | ||
190 | ''; | 190 | ''; |
191 | }) | 191 | }) |
192 | ); | 192 | ); |