From 22ea90ebf57e3dc784cae96a7f6bcf073b1aafe7 Mon Sep 17 00:00:00 2001 From: sefidel Date: Wed, 16 Aug 2023 23:22:05 +0900 Subject: feat(nixos/alpha): prevent backups from failing on resume --- nixos/alpha/configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nixos/alpha') diff --git a/nixos/alpha/configuration.nix b/nixos/alpha/configuration.nix index d018e47..ca69a37 100644 --- a/nixos/alpha/configuration.nix +++ b/nixos/alpha/configuration.nix @@ -137,6 +137,14 @@ compression = "auto,zstd"; startAt = "*-*-* 03:00:00"; persistentTimer = true; + inhibitsSleep = true; + }; + + systemd.services."borgbackup-job-alpha-rolling" = { + preStart = lib.mkBefore '' + # Wait until internet is reachable after resuming + until /run/wrappers/bin/ping rsync.net -c1 -q >/dev/null; do :; done + ''; }; services.openssh.knownHosts."hk-s020.rsync.net".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILcPl9x9JfRFwsn09NnDw/xBZbAN80ZQck+h6AqlVqPH"; -- cgit 1.4.1