fix(backups): improve reliability
This commit is contained in:
1 parent
4498e8303c
commit
432a4c107a
1 file changed
+12
@@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user