From 432a4c107a5d3f084cc5d15704d2fbc0cdc1853c Mon Sep 17 00:00:00 2001 From: hektor Date: Tue, 20 Oct 2026 23:31:55 +0200 Subject: [PATCH] fix(backups): improve reliability --- modules/backups/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/backups/default.nix b/modules/backups/default.nix index 6bfc657..5993270 100644 --- a/modules/backups/default.nix +++ b/modules/backups/default.nix @@ -21,6 +21,11 @@ in type = lib.types.listOf lib.types.str; default = [ "/home" ]; }; + + inhibitsSleep = lib.mkOption { + type = lib.types.bool; + default = config.host.role != "laptop"; + }; }; config = lib.mkIf cfg.enable { @@ -53,6 +58,7 @@ in Persistent = true; }; initialize = true; + inherit (cfg) inhibitsSleep; extraBackupArgs = [ "--one-file-system" ]; pruneOpts = [ "--keep-daily 7" @@ -62,5 +68,11 @@ in ]; environmentFile = config.sops.templates."restic/b2-env-${host}".path; }; + + systemd.services.restic-backups-home = { + unitConfig = { + RequiresMountsFor = cfg.paths; + }; + }; }; }