From f44838ffc96c0a88a968502d5687aef7cf43b1d3 Mon Sep 17 00:00:00 2001 From: harry Date: Fri, 19 Jul 2024 13:59:34 +0200 Subject: [PATCH] added missing postgres --- features/synapse-matrix.nix | 47 ++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/features/synapse-matrix.nix b/features/synapse-matrix.nix index d2a4152..45ccdf3 100644 --- a/features/synapse-matrix.nix +++ b/features/synapse-matrix.nix @@ -1,11 +1,26 @@ -{ config, lib, ... }: -#TODO: implement { + pkgs, + config, + lib, + ... +}: +#TODO: implement +let + baseUrl = "talk.hypervirtual.world"; +in +{ + + sops.secrets.matrix-shared-secret = { + sopsFile = ../secrets/matrix.yaml; + format = "yaml"; + }; + services.matrix-synapse = { enable = true; settings = { - serverName = "talk.hypervirtual.world"; + serverName = baseUrl; + public_baseurl = baseUrl; enable_registration = false; }; @@ -17,5 +32,31 @@ "url-preview" "user-search" ]; + + extraConfigFiles = [ "/run/secrets/matrix-shared-secret" ]; + + listeners = [ + { + port = 8008; + bind_addresses = [ "::1" ]; + type = "http"; + tls = false; + x_forwarded = true; + resources = [ + { + names = [ + "client" + "federation" + ]; + compress = true; + } + ]; + } + ]; + }; + + services.postgres = { + enable = true; + package = pkgs.postgresql_15; }; }