summaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-08-13 09:46:55 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-08-13 09:46:55 +0200
commit65c95bf40c33277483c39104220315a3192a86e0 (patch)
tree0ebc3c07068e6d64ffad05a8e1e315447753943f /custom
parentd1e4c8fee500324ea69415924382843f33a8166a (diff)
downloadnixos-65c95bf40c33277483c39104220315a3192a86e0.tar
nixos-65c95bf40c33277483c39104220315a3192a86e0.tar.gz
nixos-65c95bf40c33277483c39104220315a3192a86e0.tar.bz2
nixos-65c95bf40c33277483c39104220315a3192a86e0.tar.xz
nixos-65c95bf40c33277483c39104220315a3192a86e0.zip
...
Diffstat (limited to 'custom')
-rw-r--r--custom/tinc/def.nix10
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 );