From a5a462fc31d0c461b440c1d15fb121317d7fcad4 Mon Sep 17 00:00:00 2001 From: Jade Date: Sun, 26 Feb 2023 21:47:24 +0100 Subject: [PATCH] chages --- schrottserver/synapse.nix | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/schrottserver/synapse.nix b/schrottserver/synapse.nix index 9d96080..0d575a4 100644 --- a/schrottserver/synapse.nix +++ b/schrottserver/synapse.nix @@ -1,10 +1,33 @@ { pkgs, ... }: { - services.matrix-synapse = { - enable = true; - settings = { - server_name = "synapse.schrottkatze.de"; - max_upload_size = "2G"; + services = { + matrix-synapse = { + enable = true; + settings = { + server_name = "synapse.schrottkatze.de"; + }; + }; + postgresql = { + enable = true; + initialScript = pkgs.writeText "synapse-init.sql" '' + CREATE ROLE "matrix-synapse"; + CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse" + TEMPLATE template0 + LC_COLLATE = "C" + LC_CTYPE = "C"; + ''; + + #initdbArgs = [ + #"--locale=C" + #"--encoding=UTF8" + #]; + ensureDatabases = [ "matrix-synapse" ]; + ensureUsers = [ + { + name = "matrix-synapse"; + ensurePermissions."DATABASE \"matrix-synapse\"" = "ALL PRIVILEGES"; + } + ]; }; }; }