feat(vps): add restic

This commit is contained in:
toast 2025-11-01 16:34:34 +09:00
parent 934f2ed339
commit 7de23d3b04
2 changed files with 33 additions and 0 deletions

View file

@ -7,5 +7,6 @@
./caddy.nix ./caddy.nix
./forgejo.nix ./forgejo.nix
./trilium-server.nix ./trilium-server.nix
./restic.nix
]; ];
} }

View 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;
};
};
}