From a05f9d694253df4c0ca946858b82d221065193b4 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Sun, 5 Nov 2023 04:48:39 -0800 Subject: [PATCH] use correct postgresql option --- modules/postgresql.nix | 2 +- test/modules/postgresql.nix | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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;