nixos/tinc: add "restartTriggers" back

Add "restartTriggers" back to restart the Tinc daemon when its peer is removed.
Reverted #27660
This commit is contained in:
volth 2017-09-27 23:16:02 +00:00 committed by GitHub
parent d05b0b6b70
commit ddd13e1375

View file

@ -163,6 +163,12 @@ in
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
path = [ data.package ];
restartTriggers =
let
drvlist = [ config.environment.etc."tinc/${network}/tinc.conf".source ]
++ mapAttrsToList (host: _: config.environment.etc."tinc/${network}/hosts/${host}".source) data.hosts;
in # drvlist might be too long to be used directly
[ (builtins.hashString "sha256" (concatMapStrings (d: d.outPath) drvlist)) ];
serviceConfig = {
Type = "simple";
Restart = "always";