From 9593e8b460759155d3dfd9da655da8e83016aae4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 12 Jun 2022 21:00:19 +0200 Subject: [PATCH 1/2] services: matrix: remove unneeded mkIf --- services/matrix.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/services/matrix.nix b/services/matrix.nix index eab7e37..e0ca675 100644 --- a/services/matrix.nix +++ b/services/matrix.nix @@ -274,11 +274,10 @@ in { my.services.restic-backup = let dataDir = config.services.matrix-synapse.dataDir; - in - mkIf cfg.enable { - paths = [dataDir]; - # this is just caching for other servers media, doesn't need backup - exclude = ["${dataDir}/media/remote_*"]; - }; + in { + paths = [dataDir]; + # this is just caching for other servers media, doesn't need backup + exclude = ["${dataDir}/media/remote_*"]; + }; }; } From d95a25c61f210839036bbce53fa5007ed359b86d Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 12 Jun 2022 21:00:36 +0200 Subject: [PATCH 2/2] 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..d28e462 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 = {