Skip to content

Commit

Permalink
nixos/tinc: add "restartTriggers" back
Browse files Browse the repository at this point in the history
Add "restartTriggers" back to restart the Tinc daemon when its peer is removed.
Reverted #27660
  • Loading branch information
volth authored and Mic92 committed Sep 27, 2017
1 parent e9bbe85 commit c868d42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nixos/modules/services/networking/tinc.nix
Expand Up @@ -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";
Expand Down

0 comments on commit c868d42

Please sign in to comment.