From b116c3a56e3bd022dbec358ccc673e0ae90153de Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 22 Jan 2022 21:10:17 +0100 Subject: [PATCH] Fix saml login! :D --- services/matrix/synapse-module/default.nix | 10 +++++----- services/matrix/synapse.nix | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/services/matrix/synapse-module/default.nix b/services/matrix/synapse-module/default.nix index 7e8bb68..fb79f2d 100644 --- a/services/matrix/synapse-module/default.nix +++ b/services/matrix/synapse-module/default.nix @@ -1,3 +1,4 @@ + { lib, pkgs, config, ... }: let @@ -433,7 +434,7 @@ in partOf = [ "matrix-synapse.target" ]; wantedBy = [ "matrix-synapse.target" ]; preStart = '' - ${cfg.package}/bin/homeserver \ + ${cfg.package}/bin/synapse_homeserver \ ${ lib.concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ matrix-synapse-common-config ] ++ cfg.extraConfigFiles) } --keys-directory ${cfg.dataDir} \ --generate-keys @@ -445,7 +446,7 @@ in Group = "matrix-synapse"; WorkingDirectory = cfg.dataDir; ExecStart = '' - ${cfg.package}/bin/homeserver \ + ${cfg.package}/bin/synapse_homeserver \ ${ lib.concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ matrix-synapse-common-config ] ++ cfg.extraConfigFiles) } --keys-directory ${cfg.dataDir} ''; @@ -471,7 +472,6 @@ in after = [ "matrix-synapse.service" ]; environment.PYTHONPATH = lib.makeSearchPathOutput "lib" cfg.package.python.sitePackages [ pluginsEnv -# (cfg.package.python.pkgs.toPythonModule cfg.package) ]; serviceConfig = { Type = "notify"; @@ -479,7 +479,7 @@ in Group = "matrix-synapse"; WorkingDirectory = cfg.dataDir; ExecStart = '' - ${cfg.package.python.withPackages (ps: [(cfg.package.python.pkgs.toPythonModule cfg.package)])}/bin/python -m synapse.app.generic_worker \ + ${cfg.package}/bin/synapse_worker \ ${ lib.concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ matrix-synapse-common-config (workerConfig worker) ] ++ cfg.extraConfigFiles) } --keys-directory ${cfg.dataDir} ''; @@ -489,4 +489,4 @@ in ) workerList); }) ]); -} \ No newline at end of file +} diff --git a/services/matrix/synapse.nix b/services/matrix/synapse.nix index 7a494d8..9c3879e 100644 --- a/services/matrix/synapse.nix +++ b/services/matrix/synapse.nix @@ -9,7 +9,7 @@ in services.matrix-synapse-next = { enable = true; - package = pkgs.unstable.matrix-synapse; # Can be stable after 21.11? + package = pkgs.matrix-synapse; dataDir = "/data/synapse"; @@ -63,13 +63,17 @@ in } ]; - enable_registration = true; enable_metrics = true; use_presence = true; + password_config.enabled = lib.mkForce false; + + enable_registration = false; + + saml2_config = { sp_config.metadata.remote = [ { url = "https://idp.pvv.ntnu.no/simplesaml/saml2/idp/metadata.php"; } @@ -146,8 +150,6 @@ in }; - password_config.enable = lib.mkForce false; - signing_key_path = "${cfg.dataDir}/homeserver.signing.key"; media_store_path = "${cfg.dataDir}/media";