nixos-config/machines/loki/barman.nix

35 lines
1.1 KiB
Nix

{ pkgs, config, ... }:
{
services.barman = {
enable = true;
package = (
pkgs.barman.overrideAttrs (prevAttrs: {
propagatedBuildInputs = prevAttrs.propagatedBuildInputs ++ [ pkgs.python3Packages.distutils ];
})
);
settings = {
barman = {
# log_file = "/var/log/barman/barman.log";
configuration_files_directory = "/etc/barman.d";
create_slot = "auto";
};
};
servers = {
ha = {
description = "Home Assistant database";
conninfo = "host=10.0.0.254 user=postgres dbname=homeassistant passfile=${config.sops.secrets.barman-passwords.path}";
wal_streaming_conninfo = "host=10.0.0.254 user=postgres dbname=homeassistant passfile=${config.sops.secrets.barman-passwords.path}";
streaming_archiver = true;
backup_method = "postgres";
slot_name = "barman";
bandwidth_limit = 0;
last_backup_maximum_age = "3 DAYS";
minimum_redundancy = 3;
retention_policy = "RECOVERY WINDOW OF 4 WEEKS";
};
};
# passwordsFile = config.sops.secrets.barman-passwords.path;
};
}