This PR continues the work started in https://github.com/ibizaman/selfhostblocks/pull/314 I had to create my own PR since I couldn't add commits on the fork. --------- Co-authored-by: sivertism <10866270+sivertism@users.noreply.github.com>
32 lines
806 B
Nix
32 lines
806 B
Nix
{ pkgs, ... }:
|
|
let
|
|
contracts = pkgs.callPackage ../../modules/contracts {};
|
|
in
|
|
{
|
|
restic_postgres = contracts.test.databasebackup {
|
|
name = "restic_postgres";
|
|
requesterRoot = [ "shb" "postgresql" ];
|
|
providerRoot = [ "shb" "restic" "databases" "postgresql" ];
|
|
modules = [
|
|
../../modules/blocks/postgresql.nix
|
|
../../modules/blocks/restic.nix
|
|
];
|
|
settings = repository: {
|
|
enable = true;
|
|
passphraseFile = toString (pkgs.writeText "passphrase" "PassPhrase");
|
|
repository = {
|
|
path = repository;
|
|
timerConfig = {
|
|
OnCalendar = "00:00:00";
|
|
};
|
|
};
|
|
};
|
|
providerExtraConfig = { username, database, ... }: {
|
|
shb.postgresql.ensures = [
|
|
{
|
|
inherit username database;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|