mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 03:49:44 +00:00
feat(vps): add Nextcloud as backup destination
This commit is contained in:
parent
4a61ec71bd
commit
f6d6f886d5
2 changed files with 31 additions and 10 deletions
|
|
@ -1,22 +1,25 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
let
|
||||
paths = [
|
||||
"/var/lib/zipline"
|
||||
"/var/lib/postgresql"
|
||||
"/var/lib/forgejo"
|
||||
"/var/lib/trilium"
|
||||
"/var/lib/bitwarden_rs"
|
||||
];
|
||||
in {
|
||||
sops.secrets = {
|
||||
"restic/password" = {};
|
||||
"restic/env" = {};
|
||||
"restic/rclone-config" = {};
|
||||
};
|
||||
|
||||
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"
|
||||
];
|
||||
paths = paths;
|
||||
repository = "s3:https://s3.us-east-005.backblazeb2.com/restic-backups-vps";
|
||||
environmentFile = config.sops.secrets."restic/env".path;
|
||||
pruneOpts = [
|
||||
|
|
@ -29,4 +32,21 @@
|
|||
Persistent = true;
|
||||
};
|
||||
};
|
||||
services.restic.backups.nextcloud = {
|
||||
initialize = true;
|
||||
inhibitsSleep = true;
|
||||
passwordFile = config.sops.secrets."restic/password".path;
|
||||
paths = paths;
|
||||
repository = "rclone:nextcloud:restic/vps";
|
||||
rcloneConfigFile = config.sops.secrets."restic/rclone-config".path;
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 4"
|
||||
"--keep-monthly 6"
|
||||
];
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue