diff --git a/configuration.nix b/configuration.nix index aefc2c0..bdb040a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -80,11 +80,6 @@ borg-backup = { enable = true; repo = (lib.removeSuffix "\n" (builtins.readFile ./borg-backup-repo)); - paths = [ - "/var/lib/matrix-synapse" - "/var/backup/postgresql" - ]; - exclude = []; }; miniflux = { diff --git a/services/bitwarden_rs.nix b/services/bitwarden_rs.nix index 0ecc9a4..b31b7a2 100644 --- a/services/bitwarden_rs.nix +++ b/services/bitwarden_rs.nix @@ -93,5 +93,11 @@ in { environment.systemPackages = with pkgs; [ bitwarden_rs-vault ]; + + my.services.borg-backup = mkIf cfg.enable { + paths = [ "/var/lib/bitwarden_rs" ]; + exclude = [ "/var/lib/bitwarden_rs/icon_cache" ]; + }; }; + } diff --git a/services/matrix.nix b/services/matrix.nix index d5abf9f..cd757ad 100644 --- a/services/matrix.nix +++ b/services/matrix.nix @@ -171,5 +171,9 @@ in { clientPort.public federationPort.public ]; + + my.services.borg-backup = mkIf cfg.enable { + paths = [ "/var/lib/matrix-synapse" ]; + }; }; } diff --git a/services/postgresql-backup.nix b/services/postgresql-backup.nix index bb37914..e8c5381 100644 --- a/services/postgresql-backup.nix +++ b/services/postgresql-backup.nix @@ -15,5 +15,14 @@ in { # Borg backup starts at midnight so create DB dump just before startAt = "*-*-* 23:30:00"; }; + + my.services.borg-backup = mkIf cfg.enable { + paths = [ "/var/backup/postgresql" ]; + + # no need to store previously backed up files, as borg does the snapshoting + # for us + exclude = [ "/var/backup/postgresql/*.prev.sql.gz" ]; + }; }; + }