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;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ "/home" ];
|
default = [ "/home" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inhibitsSleep = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = config.host.role != "laptop";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
@@ -53,6 +58,7 @@ in
|
|||||||
Persistent = true;
|
Persistent = true;
|
||||||
};
|
};
|
||||||
initialize = true;
|
initialize = true;
|
||||||
|
inherit (cfg) inhibitsSleep;
|
||||||
extraBackupArgs = [ "--one-file-system" ];
|
extraBackupArgs = [ "--one-file-system" ];
|
||||||
pruneOpts = [
|
pruneOpts = [
|
||||||
"--keep-daily 7"
|
"--keep-daily 7"
|
||||||
@@ -62,5 +68,11 @@ in
|
|||||||
];
|
];
|
||||||
environmentFile = config.sops.templates."restic/b2-env-${host}".path;
|
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