restic: add daily external backups of all safe/backups
This commit is contained in:
parent
d4d8236501
commit
3a0792caec
7 changed files with 64 additions and 1 deletions
30
shared/applications/server/restic.nix
Normal file
30
shared/applications/server/restic.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ 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"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -19,5 +19,6 @@ in {
|
|||
# mine.shared.settings.domain = "${config.mine.shared.settings.domain_sld}.${config.mine.shared.settings.domain_tld}";
|
||||
mine.shared.settings.domain = "fricloud.dk";
|
||||
|
||||
mine.shared.settings.brand_lower = "fricloud";
|
||||
mine.shared.settings.brand = "Fricloud";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue