From a24a5e5da434d2624fa02a98212f4c83397fad6d Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Fri, 1 Dec 2023 06:07:53 +0100 Subject: [PATCH] update to 23.11 --- MIGRATIONS.MD | 4 ++-- synapse-module/default.nix | 25 ++++++++++++++++++------- synapse-module/workers.nix | 9 ++------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/MIGRATIONS.MD b/MIGRATIONS.MD index 342a45e..41391f8 100644 --- a/MIGRATIONS.MD +++ b/MIGRATIONS.MD @@ -4,7 +4,7 @@ This is a best effort document descibing neccecary changes you might have to do ## 0.5.0 UNRELEASED -The module has been renamed from `synapse` to `default` - +* The module has been renamed from `synapse` to `default` +* The synapse module now expects a wrapper-style package. This means the module is now incompatible with nixpkgs < 23.11. diff --git a/synapse-module/default.nix b/synapse-module/default.nix index 54dc8e1..45eb879 100644 --- a/synapse-module/default.nix +++ b/synapse-module/default.nix @@ -11,8 +11,22 @@ let format = pkgs.formats.yaml {}; matrix-synapse-common-config = format.generate "matrix-synapse-common-config.yaml" cfg.settings; - pluginsEnv = cfg.package.python.buildEnv.override { - extraLibs = cfg.plugins; + + # TODO: Align better with the upstream module + wrapped = cfg.package.override { + inherit (cfg) plugins; + extras = [ + "postgres" + "saml2" + "oidc" + "systemd" + "url-preview" + "sentry" + "jwt" + "redis" + "cache-memory" + "user-search" + ]; }; inherit (lib) @@ -33,7 +47,7 @@ in imports = [ ./nginx.nix (import ./workers.nix { - inherit matrix-lib throw' format matrix-synapse-common-config pluginsEnv; + inherit matrix-lib throw' format matrix-synapse-common-config wrapped; }) ]; @@ -376,9 +390,6 @@ in }; in "${cfg.package}/bin/synapse_homeserver ${flags}"; - environment.PYTHONPATH = - lib.makeSearchPathOutput "lib" cfg.package.python.sitePackages [ pluginsEnv ]; - serviceConfig = { Type = "notify"; User = "matrix-synapse"; @@ -390,7 +401,7 @@ in config-path = [ matrix-synapse-common-config ] ++ cfg.extraConfigFiles; keys-directory = cfg.dataDir; }; - in "${cfg.package}/bin/synapse_homeserver ${flags}"; + in "${wrapped}/bin/synapse_homeserver ${flags}"; ExecReload = "${pkgs.utillinux}/bin/kill -HUP $MAINPID"; Restart = "on-failure"; }; diff --git a/synapse-module/workers.nix b/synapse-module/workers.nix index cdf1ba9..4c5fd2c 100644 --- a/synapse-module/workers.nix +++ b/synapse-module/workers.nix @@ -1,6 +1,6 @@ { matrix-synapse-common-config, matrix-lib, - pluginsEnv, + wrapped, throw', format }: @@ -333,11 +333,6 @@ in { wantedBy = [ "matrix-synapse.target" ]; after = [ "matrix-synapse.service" ]; requires = [ "matrix-synapse.service" ]; - environment = { - PYTHONPATH = lib.makeSearchPathOutput "lib" cfg.package.python.sitePackages [ - pluginsEnv - ]; - }; serviceConfig = { Type = "notify"; User = "matrix-synapse"; @@ -355,7 +350,7 @@ in { config-path = [ matrix-synapse-common-config (workerConfig worker) ] ++ cfg.extraConfigFiles; keys-directory = cfg.dataDir; }; - in "${cfg.package}/bin/synapse_worker ${flags}"; + in "${wrapped}/bin/synapse_worker ${flags}"; }; }; }));