summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-12-21 15:03:44 +0100
committerlassulus <lassulus@lassul.us>2021-12-21 15:03:44 +0100
commit45982ce499804ceb4dad7efed2023a5a7f65a86a (patch)
treec192970131bbd2a93ecbcd47b4f62f8972f23863 /krebs
parent0a7d779cc1823ea0f62813211ac792016cbed81c (diff)
WIP tinc module: reload instead of restarttinc-reload
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/tinc.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix
index b12fe6050..fb4f9727a 100644
--- a/krebs/3modules/tinc.nix
+++ b/krebs/3modules/tinc.nix
@@ -17,7 +17,6 @@ let
in {
enable = mkEnableOption "krebs.tinc.${netname}" // { default = true; };
- enableLegacy = mkEnableOption "/etc/tinc/${netname}";
confDir = mkOption {
type = types.package;
@@ -263,9 +262,9 @@ let
) config.krebs.tinc;
environment.etc = mapAttrs' (netname: cfg:
- nameValuePair "tinc/${netname}" (mkIf cfg.enableLegacy {
+ nameValuePair "tinc/${netname}" {
source = cfg.confDir;
- })
+ }
) config.krebs.tinc;
systemd.services = mapAttrs (netname: cfg:
@@ -287,9 +286,13 @@ let
];
wantedBy = [ "multi-user.target" ];
path = [ tinc iproute ];
+ reloadIfChanged = true;
+ restartIfChanged = false;
+ restartTriggers = [ cfg.confDir ];
serviceConfig = rec {
Restart = "always";
- ExecStart = "${tinc}/sbin/tincd -c ${cfg.confDir} -d 0 -U ${cfg.user.name} -D --pidfile=/var/run/tinc.${SyslogIdentifier}.pid";
+ ExecStart = "${tinc}/sbin/tincd -c /etc/tinc/${netname} -d 0 -U ${cfg.user.name} -D --pidfile=/var/run/tinc.${SyslogIdentifier}.pid";
+ ExecReload = "${tinc}/sbin/tinc -n ${netname} reload";
SyslogIdentifier = netname;
};
}