Configure borg for grondahl

This commit is contained in:
Amanda Graven 2023-10-26 16:56:34 +02:00
parent 8d718be321
commit b43a55bb9f
Signed by: amanda
GPG key ID: F747582C5608F4CB
5 changed files with 27 additions and 27 deletions

View file

@ -10,9 +10,9 @@
../../common/services/tailscale.nix
../../common/users.nix
./services/acme.nix
./services/borg.nix
./services/coturn.nix
./services/nginx.nix
./services/restic.nix
./services/synapse.nix
./services/postgres.nix
#./services/mail.nix

Binary file not shown.

View file

@ -0,0 +1,26 @@
{ config, ... }:
{
services.borgbackup.jobs = {
postgres = {
paths = "/var/lib/postgresql/backup";
repo = "ssh://borg@despondos.nao.sh//mnt/slab/backup/grondahl/postgres";
encryption.mode = "repokey";
encryption.passCommand = "cat ${config.secrets.files.borg_pass_postgres.file}";
environment.BORG_RSH = "ssh -i ${config.secrets.files.ssh_key_postgres.file}";
compression = "auto,zstd";
startAt = "*-*-* 03:15:00";
user = "postgres";
};
synapse = {
paths = "/var/lib/matrix-synapse";
repo = "ssh://borg@despondos.nao.sh//mnt/slab/backup/grondahl/synapse";
encryption.mode = "repokey";
encryption.passCommand = "cat ${config.secrets.files.borg_pass_synapse.file}";
environment.BORG_RSH = "ssh -i ${config.secrets.files.ssh_key_synapse.file}";
compression = "auto,zstd";
startAt = "*-*-* 03:45:00";
user = "matrix-synapse";
};
};
}

View file

@ -1,26 +0,0 @@
{ config, ... }:
{
services.restic.backups = {
"postgres" = {
paths = [ "/var/lib/postgresql/backup" ];
repository = "sftp:restic@despondos.nao.sh:/etheria/backup/grondahl/postgres";
initialize = true;
pruneOpts = [ "--keep-daily 7" "--keep-weekly 5" "--keep-monthly 12" "--keep-yearly 75" ];
timerConfig = { "OnCalendar" = "03:15"; };
extraOptions = [ "sftp.command='ssh restic@despondos.nao.sh -i ${config.secrets.files.ssh_key.file} -s sftp'" ];
passwordFile = builtins.toString config.secrets.files.restic_pass.file;
user = "postgres";
};
"synapse" = {
paths = [ "/var/lib/matrix-synapse" ];
repository = "sftp:restic@despondos.nao.sh:/etheria/backup/grondahl/synapse";
initialize = true;
pruneOpts = [ "--keep-daily 7" "--keep-weekly 5" "--keep-monthly 12" "--keep-yearly 75" ];
timerConfig = { "OnCalendar" = "03:45"; };
extraOptions = [ "sftp.command='ssh restic@despondos.nao.sh -i ${config.secrets.files.ssh_key.file} -s sftp'" ];
passwordFile = builtins.toString config.secrets.files.restic_pass.file;
user = "matrix-synapse";
};
};
}