diff --git a/config/hosts/grondahl/configuration.nix b/config/hosts/grondahl/configuration.nix index 1545408..a79f9c8 100644 --- a/config/hosts/grondahl/configuration.nix +++ b/config/hosts/grondahl/configuration.nix @@ -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 diff --git a/config/hosts/grondahl/data/secrets/borg_pass b/config/hosts/grondahl/data/secrets/borg_pass new file mode 100644 index 0000000..1d65621 Binary files /dev/null and b/config/hosts/grondahl/data/secrets/borg_pass differ diff --git a/config/hosts/grondahl/data/secrets/secrets.nix b/config/hosts/grondahl/data/secrets/secrets.nix index b79d57c..1c37a01 100644 Binary files a/config/hosts/grondahl/data/secrets/secrets.nix and b/config/hosts/grondahl/data/secrets/secrets.nix differ diff --git a/config/hosts/grondahl/services/borg.nix b/config/hosts/grondahl/services/borg.nix new file mode 100644 index 0000000..6134c7f --- /dev/null +++ b/config/hosts/grondahl/services/borg.nix @@ -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"; + }; + }; +} diff --git a/config/hosts/grondahl/services/restic.nix b/config/hosts/grondahl/services/restic.nix deleted file mode 100644 index f92203e..0000000 --- a/config/hosts/grondahl/services/restic.nix +++ /dev/null @@ -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"; - }; - }; -} -