From dce3fcf490c7bb35f1cba3f512a2e841ed1fd527 Mon Sep 17 00:00:00 2001 From: "Shahar \"Dawn\" Or" Date: Wed, 14 Feb 2024 12:42:12 +0700 Subject: [PATCH] mcaptcha: replace ensurePermissions Towards #126 --- modules/mcaptcha.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/mcaptcha.nix b/modules/mcaptcha.nix index 70157ddd..64b708dd 100644 --- a/modules/mcaptcha.nix +++ b/modules/mcaptcha.nix @@ -262,11 +262,14 @@ in { ensureUsers = [ { name = cfg.user; - ensurePermissions = {"DATABASE ${cfg.settings.database.name}" = "ALL PRIVILEGES";}; } ]; }; + systemd.services.postgresql.postStart = lib.mkIf cfg.database.createLocally (lib.mkAfter '' + $PSQL ${cfg.settings.database.name} -c 'GRANT ALL PRIVILEGES ON SCHEMA public TO "${cfg.user}"' + ''); + services.redis.servers.mcaptcha = lib.mkIf cfg.redis.createLocally { enable = true; port = cfg.redis.port;