diff --git a/programs/borg.nix b/programs/borg.nix index 8668334..d944ecd 100644 --- a/programs/borg.nix +++ b/programs/borg.nix @@ -23,4 +23,22 @@ in { }; }; }; + + systemd.services = { + borgbackup-backup-job = { + after = ["ensure-online.service"]; + requires = ["ensure-online.service"]; + }; + + ensure-online = { + description = "waiting for Network"; + after = ["network-online.target"]; + requires = ["network-online.target"]; + + serviceConfig = { + ExecStart = "${pkgs.networkmanager}/bin/nm-online -q --timeout=300"; + Type = "oneshot"; + }; + }; + }; }