31 lines
752 B
Nix
31 lines
752 B
Nix
|
{ config, lib, ... }:
|
||
|
|
||
|
{
|
||
|
services.restic = {
|
||
|
# enable = true;
|
||
|
|
||
|
backups.main = {
|
||
|
repository = "b2:situla-${config.mine.shared.settings.brand_lower}:.";
|
||
|
|
||
|
passwordFile = config.age.secrets."restic-pass".path;
|
||
|
environmentFile = config.age.secrets."restic-env".path;
|
||
|
|
||
|
# take all `.*/safe/.*` and `.*/backup/.*` zfs volumes
|
||
|
paths = let
|
||
|
backupPaths = lib.filterAttrs (n: _:
|
||
|
(lib.hasInfix "/safe/" n) || (lib.hasInfix "/backup/" n)
|
||
|
) config.mine.zfsMounts;
|
||
|
in lib.attrValues backupPaths;
|
||
|
|
||
|
initialize = true;
|
||
|
runCheck = true;
|
||
|
pruneOpts = [
|
||
|
"--keep-last 7"
|
||
|
"--keep-weekly 4"
|
||
|
"--keep-monthly 6"
|
||
|
"--keep-yearly 2"
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
}
|