X-Git-Url: http://git.scottworley.com/syncthing-autoregister/blobdiff_plain/64eaba73071fd33f2c824b9d5bc38f3a113eeb90..0043dc6823fd9acc5199976084507feb564f4ff0:/modules/syncthing-autoregister.nix?ds=inline diff --git a/modules/syncthing-autoregister.nix b/modules/syncthing-autoregister.nix index da9df86..ad710f6 100644 --- a/modules/syncthing-autoregister.nix +++ b/modules/syncthing-autoregister.nix @@ -45,6 +45,20 @@ in { ExecStart = register-script; }; }; + systemd.services.syncthing-reregister = { + after = [ "syncthing-autoregister.service" ]; + script = '' + ${pkgs.coreutils}/bin/sleep 1 + ${pkgs.systemd}/bin/systemctl restart syncthing-autoregister + ''; + serviceConfig = { + Type = "oneshot"; + }; + }; + systemd.paths.syncthing-reregister = { + pathConfig.PathChanged = cfg.path; + wantedBy = [ "multi-user.target" ]; + }; }; }