1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 11:37:44 +00:00

Set PG users in the respective config file

This commit is contained in:
RGBCube 2024-01-16 11:49:36 +03:00
parent b1fe5a5a32
commit fd99434022
No known key found for this signature in database
3 changed files with 19 additions and 10 deletions

View file

@ -13,6 +13,14 @@ in serverSystemConfiguration {
maxretry = 3;
};
services.postgresql = {
ensureDatabases = [ "grafana" ];
ensureUsers = [{
name = "grafana";
ensureDBOwnership = true;
}];
};
systemd.services.grafana.requires = [ "postgresql.service" ];
services.grafana = enabled {

View file

@ -7,6 +7,14 @@ let
in serverSystemConfiguration {
age.secrets."cube/password.nextcloud".owner = "nextcloud";
services.postgresql = {
ensureDatabases = [ "nextcloud" ];
ensureUsers = [{
name = "nextcloud";
ensureDBOwnership = true;
}];
};
systemd.services = {
nextcloud-setup.requires = [ "postgresql.service" ];
phpfpm-nextcloud.aliases = [ "nextcloud.service" ];

View file

@ -27,13 +27,11 @@
identMap = ''
# Map System DBUser
superuser_map root postgres
superuser_map postgres postgres
superuser_map root ^(.*)$
superuser_map postgres ^(.*)$
superuser_map /^(.*)$ \1
'';
ensureDatabases = [ "grafana" "nextcloud" ];
ensureUsers = [
{
name = "postgres";
@ -46,12 +44,7 @@
};
}
{
name = "grafana";
ensureDBOwnership = true;
}
{
name = "nextcloud";
ensureDBOwnership = true;
name = "root";
}
];