From 7facff578b148539a87ce0af2c404fadb7af0b17 Mon Sep 17 00:00:00 2001 From: zuckerberg <5-zuckerberg@users.noreply.git.neet.dev> Date: Fri, 21 May 2021 11:01:06 -0400 Subject: [PATCH] use postgres for matrix + move host --- common/server/matrix.nix | 10 +++++++++- machines/nanachi/configuration.nix | 18 ++++++++++++++++++ machines/neet.dev/configuration.nix | 18 ------------------ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/common/server/matrix.nix b/common/server/matrix.nix index 29289da..191571e 100644 --- a/common/server/matrix.nix +++ b/common/server/matrix.nix @@ -60,7 +60,6 @@ in { services.matrix-synapse = { enable = true; server_name = cfg.host; - database_type = "sqlite3"; enable_registration = cfg.enable_registration; listeners = [ { bind_address = "127.0.0.1"; @@ -161,6 +160,15 @@ in { }; }; + services.postgresql.enable = true; + services.postgresql.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.jitsi-meet = lib.mkIf cfg.jitsi-meet.enable { enable = true; hostName = cfg.jitsi-meet.host; diff --git a/machines/nanachi/configuration.nix b/machines/nanachi/configuration.nix index 0676edb..7d9870e 100644 --- a/machines/nanachi/configuration.nix +++ b/machines/nanachi/configuration.nix @@ -30,6 +30,24 @@ mount = "stream.webm"; }; + services.matrix = { + enable = true; + host = "neet.space"; + enable_registration = false; + element-web = { + enable = true; + host = "chat.neet.space"; + }; + jitsi-meet = { + enable = true; + host = "meet.neet.space"; + }; + turn = { + host = "turn.neet.space"; + secret = "a8369a0e96922abf72494bb888c85831b"; + }; + }; + security.acme.acceptTerms = true; security.acme.email = "letsencrypt+5@tar.ninja"; diff --git a/machines/neet.dev/configuration.nix b/machines/neet.dev/configuration.nix index 687843e..9d1841f 100644 --- a/machines/neet.dev/configuration.nix +++ b/machines/neet.dev/configuration.nix @@ -51,22 +51,4 @@ port = 23563; domain = "voice.neet.space"; }; - - services.matrix = { - enable = true; - host = "neet.space"; - enable_registration = false; - element-web = { - enable = true; - host = "chat.neet.space"; - }; - jitsi-meet = { - enable = true; - host = "meet.neet.space"; - }; - turn = { - host = "turn.neet.space"; - secret = "a8369a0e96922abf72494bb888c85831b"; - }; - }; }