diff --git a/modules/postgresql.nix b/modules/postgresql.nix index bced82f..9b99bae 100644 --- a/modules/postgresql.nix +++ b/modules/postgresql.nix @@ -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"; diff --git a/test/modules/postgresql.nix b/test/modules/postgresql.nix index f76889d..462ba78 100644 --- a/test/modules/postgresql.nix +++ b/test/modules/postgresql.nix @@ -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;