nix-deploy/config/hosts/rudiger/services/postgres.nix

25 lines
424 B
Nix
Raw Permalink Normal View History

2021-09-27 14:55:55 +02:00
{ ... }:
{
services.postgresql = {
enable = true;
2022-02-14 12:29:36 +01:00
ensureDatabases = [
"nextcloud"
];
2021-09-27 14:55:55 +02:00
ensureUsers = [
2022-02-14 12:29:36 +01:00
{
name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
2021-09-27 14:55:55 +02:00
];
};
2021-09-28 11:55:33 +02:00
services.postgresqlBackup = {
enable = true;
location = "/var/lib/postgresql/backup";
2022-02-14 12:29:36 +01:00
databases = [ "nextcloud" ];
2021-09-28 11:55:33 +02:00
startAt = "02:30";
compression = "none";
};
2021-09-27 14:55:55 +02:00
}