about summary refs log tree commit diff
path: root/nixos/alpha
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2023-08-16 23:22:05 +0900
committersefidel <contact@sefidel.net>2023-08-16 23:22:05 +0900
commit22ea90ebf57e3dc784cae96a7f6bcf073b1aafe7 (patch)
tree5e7e63f6a6af9a5f73b24a102c802c43384c0ace /nixos/alpha
parentefdb84113dd882084d9164b185781d32e7d7745e (diff)
downloadnixrc-22ea90ebf57e3dc784cae96a7f6bcf073b1aafe7.tar.gz
nixrc-22ea90ebf57e3dc784cae96a7f6bcf073b1aafe7.zip
feat(nixos/alpha): prevent backups from failing on resume
Diffstat (limited to 'nixos/alpha')
-rw-r--r--nixos/alpha/configuration.nix8
1 files changed, 8 insertions, 0 deletions
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";