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

26 lines
431 B
Nix
Raw Normal View History

2023-12-08 13:33:57 +01:00
{ pkgs, ... }:
2021-09-27 14:55:55 +02:00
{
services.postgresql = {
enable = true;
2023-12-08 13:33:57 +01:00
package = pkgs.postgresql_15;
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";
2023-12-08 14:05:12 +01:00
ensureDBOwnership = true;
2022-02-14 12:29:36 +01:00
}
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
}