Configure borg for grondahl
This commit is contained in:
parent
8d718be321
commit
b43a55bb9f
|
@ -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
|
||||
|
|
BIN
config/hosts/grondahl/data/secrets/borg_pass
Normal file
BIN
config/hosts/grondahl/data/secrets/borg_pass
Normal file
Binary file not shown.
Binary file not shown.
26
config/hosts/grondahl/services/borg.nix
Normal file
26
config/hosts/grondahl/services/borg.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in a new issue