mirror of
https://github.com/tboerger/nixos-config
synced 2024-11-23 03:32:08 +01:00
47 lines
714 B
Nix
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" ];
|
|
};
|
|
};
|
|
};
|
|
}
|