From 4f64939c2a074dfea9f31c75e84c28bb008507ab Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Sun, 26 Nov 2023 15:56:56 +0100 Subject: [PATCH] Use new option to set database owners --- nixos-configurations/server/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nixos-configurations/server/default.nix b/nixos-configurations/server/default.nix index 93eb7a7..4918075 100644 --- a/nixos-configurations/server/default.nix +++ b/nixos-configurations/server/default.nix @@ -127,16 +127,14 @@ enable = true; package = pkgs.postgresql_15; ensureDatabases = [ "dcbot" "hedgedoc" "todos" "gitea" ]; - # ALTER DATABASE mydb OWNER TO admin; - # The user also needs to be the owner of the specific database, which cannot be declaratively set up from this module ensureUsers = [ { name = "hedgedoc"; - ensurePermissions."DATABASE hedgedoc" = "ALL PRIVILEGES"; + ensureDBOwnership = true; } { name = "gitea"; - ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES"; + ensureDBOwnership = true; } ]; authentication = lib.mkForce ''