diff --git a/configuration.nix b/configuration.nix index 7fc57a1..d5e6cd0 100644 --- a/configuration.nix +++ b/configuration.nix @@ -76,6 +76,7 @@ repo = (lib.removeSuffix "\n" (builtins.readFile ./borg-backup-repo)); paths = [ "/var/lib/matrix-synapse" + "/var/backup/postgresql" ]; exclude = []; }; diff --git a/services/matrix.nix b/services/matrix.nix index 5d72cf2..1eedc98 100644 --- a/services/matrix.nix +++ b/services/matrix.nix @@ -28,6 +28,13 @@ in { package = pkgs.postgresql_12; }; + services.postgresqlBackup = { + enable = true; + databases = [ "matrix-synapse" ]; + # Borg backup starts at midnight so create DB dump just before + startAt = "*-*-* 23:30:00"; + }; + services.matrix-synapse = { enable = true; server_name = domain;