fix(borg): ensure we're online before running backups

This commit is contained in:
buffet 2022-09-05 16:27:07 +00:00
parent 0ed6fbaa63
commit 876de6ca1d

View file

@ -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";
};
};
};
} }