From 6b1de02ea3bfbf5eb321ec3aece91cd109c20080 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 4 Feb 2021 17:06:11 +0100 Subject: [PATCH] services: matrix: configure DB on launch --- services/matrix.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/matrix.nix b/services/matrix.nix index fb82e33..965e303 100644 --- a/services/matrix.nix +++ b/services/matrix.nix @@ -24,6 +24,13 @@ in services.postgresql = { enable = true; package = pkgs.postgresql_12; + initialScript = pkgs.writeText "synapse-init.sql" '' + CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse'; + CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse" + TEMPLATE template0 + LC_COLLATE = "C" + LC_CTYPE = "C"; + ''; }; services.postgresqlBackup = {