sets up vaultwarden backup

This commit is contained in:
Dennis Schoepf 2025-11-09 18:08:34 +01:00
parent 1a6aa16251
commit cc6518a847
2 changed files with 26 additions and 2 deletions

View file

@ -115,6 +115,7 @@
wget
docker-compose
actual-server
restic
];
# Programs
@ -160,6 +161,26 @@
'';
};
# Restic
services.restic.backups.dnsc-vps-sm-backup = {
initialize = true;
passwordFile = config.age.secrets."restic/password".path;
repository = "sftp:dnsc-storage:restic/dnsc-vps-sm";
paths = [
"/var/backup/vaultwarden"
];
pruneOpts = [
"--keep-daily 1"
"--keep-weekly 3"
"--keep-monthly 5"
"--keep-yearly 10"
];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
# Environment variables
environment.variables.EDITOR = "nvim";

View file

@ -1,8 +1,11 @@
{
config, ...
}: {
config,
...
}:
{
services.vaultwarden = {
enable = true;
environmentFile = config.age.secrets."vaultwarden/env".path;
backupDir = "/var/backup/vaultwarden";
};
}