summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/tinc.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2022-01-03 14:32:14 +0100
committertv <tv@krebsco.de>2022-01-03 14:32:14 +0100
commite8611251e6e40a50dedfe8efaa8ea555a96e1a9d (patch)
treeb2062294c7a157b04ff0cdfb56e1c156364a7577 /krebs/3modules/tinc.nix
parentdb6e1a0dfc91ea25c0eeebb5254156469f209265 (diff)
parent2313e962e2ac6dc6f1f59800d793101f958e8b37 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs/3modules/tinc.nix')
-rw-r--r--krebs/3modules/tinc.nix15
1 files changed, 7 insertions, 8 deletions
diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix
index a18248351..21ddde1c6 100644
--- a/krebs/3modules/tinc.nix
+++ b/krebs/3modules/tinc.nix
@@ -222,12 +222,6 @@ with import <stockholm/lib>;
nameValuePair netname {}
) config.krebs.tinc;
- environment.etc = mapAttrs' (netname: cfg:
- nameValuePair "tinc/${netname}" {
- source = cfg.confDir;
- }
- ) config.krebs.tinc;
-
krebs.systemd.services = mapAttrs (netname: cfg: {
}) config.krebs.tinc;
@@ -239,8 +233,6 @@ with import <stockholm/lib>;
cfg.iproutePackage
cfg.tincPackage
];
- reloadIfChanged = true;
- restartTriggers = [ cfg.confDir ];
serviceConfig = {
Restart = "always";
LoadCredential = filter (x: x != "") [
@@ -249,6 +241,13 @@ with import <stockholm/lib>;
)
"rsa_key:${cfg.privkey}"
];
+ ExecStartPre = pkgs.writers.writeDash "init-tinc-${netname}" ''
+ ${pkgs.coreutils}/bin/mkdir -p /etc/tinc
+ ${pkgs.rsync}/bin/rsync -vaL --delete \
+ --chown ${cfg.user.name} \
+ --chmod u=rwX,g=rX \
+ ${cfg.confDir}/ /etc/tinc/${netname}/
+ '';
ExecStart = toString [
"${cfg.tincPackage}/sbin/tincd"
"-D"