NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.69k stars 13.14k forks source link

services.restic: Add option for starting restic backup after systemd unit completes #153689

Open jdheyburn opened 2 years ago

jdheyburn commented 2 years ago

Issue description

Looking to see if anyone else in restic community sees value in allowing for an option in the config to invoke a restic backup After the conclusion of another service.

Example use case: chaining restic backups sequentially so as to not overload the OS or other resources.

  services.restic.backups.my-backup = {
     # removed for brevity
     serviceConfig = {
       after  = [ "some-other-service.service" ];
     };
  };

Steps to reproduce

N/A

Technical details

N/A

jacobgreenleaf commented 1 year ago

Can this be used to fix #196547?

jdheyburn commented 1 year ago

@jacobgreenleaf I believe it could, but I think perhaps serviceConfig should include network-online.target in the after by default, or only if Persistent is true. That's probably a discussion for over there.