1
0
mirror of https://github.com/tboerger/nixos-config synced 2024-11-22 18:21:58 +01:00
github.com-tboerger-nixos-c.../shared/services/cloud/postgres.nix
2024-07-17 16:05:33 +02:00

47 lines
714 B
Nix

{ pkgs, config, lib, ... }:
with lib;
{
services = {
prometheus = {
exporters = {
postgres = {
enable = true;
openFirewall = true;
runAsLocalSuperUser = true;
};
};
};
postgresql = {
enable = true;
ensureDatabases = [
"nextcloud"
];
ensureUsers = [{
name = "nextcloud";
ensureDBOwnership = true;
}];
};
postgresqlBackup = {
enable = true;
databases = [
"nextcloud"
];
};
};
systemd = {
services = {
nextcloud-setup = {
after = [ "postgresql.service" ];
requires = [ "postgresql.service" ];
};
};
};
}