From 82624606dbb3b4f09667bf701279b4192232d480 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 12 Jun 2022 21:00:36 +0200 Subject: [PATCH] services: matrix: make sure db and role exist --- services/matrix.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/matrix.nix b/services/matrix.nix index e0ca675..2ca457b 100644 --- a/services/matrix.nix +++ b/services/matrix.nix @@ -53,6 +53,14 @@ in { config = mkIf cfg.enable { services.postgresql = { enable = true; + + ensureDatabases = ["matrix-synapse"]; + ensureUsers = [ + { + name = "matrix-synapse"; + ensurePermissions."DATABASE 'matrix-synapse'" = "ALL PRIVILEGES"; + } + ]; }; services.postgresqlBackup = {