mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 03:49:44 +00:00
feat(vps): add restic
This commit is contained in:
parent
934f2ed339
commit
7de23d3b04
2 changed files with 33 additions and 0 deletions
|
|
@ -7,5 +7,6 @@
|
||||||
./caddy.nix
|
./caddy.nix
|
||||||
./forgejo.nix
|
./forgejo.nix
|
||||||
./trilium-server.nix
|
./trilium-server.nix
|
||||||
|
./restic.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
32
hosts/vps/modules/services/restic.nix
Normal file
32
hosts/vps/modules/services/restic.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
sops.secrets = {
|
||||||
|
"restic/password" = {};
|
||||||
|
"restic/env" = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.restic.backups.b2 = {
|
||||||
|
initialize = true;
|
||||||
|
inhibitsSleep = true;
|
||||||
|
passwordFile = config.sops.secrets."restic/password".path;
|
||||||
|
paths = [
|
||||||
|
"/var/lib/zipline"
|
||||||
|
"/var/lib/postgresql"
|
||||||
|
"/var/lib/forgejo"
|
||||||
|
"/var/lib/trilium"
|
||||||
|
"/var/lib/bitwarden_rs"
|
||||||
|
];
|
||||||
|
repository = "s3:https://s3.us-east-005.backblazeb2.com/restic-backups-vps";
|
||||||
|
environmentFile = config.sops.secrets."restic/env".path;
|
||||||
|
pruneOpts = [
|
||||||
|
"--keep-daily 7"
|
||||||
|
"--keep-weekly 3"
|
||||||
|
"--keep-monthly 3"
|
||||||
|
];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "daily";
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue