summaryrefslogtreecommitdiff
path: root/custom/tinc/def.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-10-28 23:36:20 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-10-28 23:36:20 +0200
commit777bd88b9fa2a9bcb38fce716fcc7be67f3ccd9a (patch)
treee0504d7bd6fb49e0b3229b29d1fb968eae37efa5 /custom/tinc/def.nix
parent5f5b00137c6f7b51eee6cc8d06373cd32728bac5 (diff)
downloadnixos-777bd88b9fa2a9bcb38fce716fcc7be67f3ccd9a.tar
nixos-777bd88b9fa2a9bcb38fce716fcc7be67f3ccd9a.tar.gz
nixos-777bd88b9fa2a9bcb38fce716fcc7be67f3ccd9a.tar.bz2
nixos-777bd88b9fa2a9bcb38fce716fcc7be67f3ccd9a.tar.xz
nixos-777bd88b9fa2a9bcb38fce716fcc7be67f3ccd9a.zip
More poking
Diffstat (limited to 'custom/tinc/def.nix')
-rw-r--r--custom/tinc/def.nix9
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