1
0
Fork 0

use correct postgresql option

This commit is contained in:
ibizaman 2023-11-05 04:48:39 -08:00
parent a49d9113f4
commit a05f9d6942
2 changed files with 5 additions and 5 deletions

View file

@ -52,7 +52,7 @@ in
dbConfig = passwordCfgs: {
services.postgresql.enable = (builtins.length passwordCfgs) > 0;
services.postgresql.ensureDatabases = map ({ database, ... }: database) passwordCfgs;
services.postgresql.Users = map ({ username, database, ... }: {
services.postgresql.ensureUsers = map ({ username, database, ... }: {
name = username;
ensurePermissions = {
"DATABASE ${database}" = "ALL PRIVILEGES";

View file

@ -28,7 +28,7 @@ in
expected = {
services.postgresql = {
enable = false;
Users = [];
ensureUsers = [];
ensureDatabases = [];
};
systemd.services.postgresql.postStart = "";
@ -40,7 +40,7 @@ in
expected = {
services.postgresql = {
enable = true;
Users = [{
ensureUsers = [{
name = "myuser";
ensurePermissions = {
"DATABASE mydatabase" = "ALL PRIVILEGES";
@ -67,7 +67,7 @@ in
expected = {
services.postgresql = {
enable = true;
Users = [{
ensureUsers = [{
name = "myuser";
ensurePermissions = {
"DATABASE mydatabase" = "ALL PRIVILEGES";
@ -104,7 +104,7 @@ in
expected = {
services.postgresql = {
enable = false;
Users = [];
ensureUsers = [];
ensureDatabases = [];
enableTCPIP = true;