1
2
mirror of https://github.com/dali99/nixos-matrix-modules.git synced 2026-01-19 14:08:21 +01:00

3 Commits

Author SHA1 Message Date
046194cdad v0.5.0
This is mostly a maintainance release to be compatible with nixos-23.11 but comes with some small improvements as well
2023-12-02 09:58:52 +01:00
3f92b5f197 use nixpkgs sliding sync package 2023-12-02 09:49:03 +01:00
a24a5e5da4 update to 23.11 2023-12-02 09:44:45 +01:00
5 changed files with 24 additions and 55 deletions

View File

@@ -2,9 +2,9 @@
This is a best effort document descibing neccecary changes you might have to do when updating This is a best effort document descibing neccecary changes you might have to do when updating
## 0.5.0 UNRELEASED ## 0.5.0
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.

View File

@@ -1,37 +0,0 @@
{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoModule rec {
pname = "matrix-sliding-sync";
version = "0.99.11";
src = fetchFromGitHub {
owner = "matrix-org";
repo = "sliding-sync";
rev = "refs/tags/v${version}";
hash = "sha256-Wd/nnJhKg+BDyOIz42zEScjzQRrpEq6YG9/9Tk24hgg=";
};
vendorHash = "sha256-0QSyYhOht1j1tWNxHQh+NUZA/W1xy7ANu+29H/gusOE=";
subPackages = [ "cmd/syncv3" ];
ldflags = [
"-s"
"-w"
"-X main.GitCommit=${src.rev}"
];
# requires a running matrix-synapse
doCheck = false;
meta = with lib; {
description = "A sliding sync implementation of MSC3575 for matrix";
homepage = "https://github.com/matrix-org/sliding-sync";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ emilylange ];
mainProgram = "syncv3";
};
}

View File

@@ -11,7 +11,7 @@ in
package = lib.mkOption { package = lib.mkOption {
type = lib.types.package; type = lib.types.package;
default = pkgs.callPackage ../pkgs/matrix-sliding-sync { }; default = pkgs.matrix-sliding-sync;
description = "What package to use for the sliding-sync proxy."; description = "What package to use for the sliding-sync proxy.";
}; };

View File

@@ -11,8 +11,22 @@ let
format = pkgs.formats.yaml {}; format = pkgs.formats.yaml {};
matrix-synapse-common-config = format.generate "matrix-synapse-common-config.yaml" cfg.settings; 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) inherit (lib)
@@ -33,7 +47,7 @@ in
imports = [ imports = [
./nginx.nix ./nginx.nix
(import ./workers.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}"; in "${cfg.package}/bin/synapse_homeserver ${flags}";
environment.PYTHONPATH =
lib.makeSearchPathOutput "lib" cfg.package.python.sitePackages [ pluginsEnv ];
serviceConfig = { serviceConfig = {
Type = "notify"; Type = "notify";
User = "matrix-synapse"; User = "matrix-synapse";
@@ -390,7 +401,7 @@ in
config-path = [ matrix-synapse-common-config ] ++ cfg.extraConfigFiles; config-path = [ matrix-synapse-common-config ] ++ cfg.extraConfigFiles;
keys-directory = cfg.dataDir; keys-directory = cfg.dataDir;
}; };
in "${cfg.package}/bin/synapse_homeserver ${flags}"; in "${wrapped}/bin/synapse_homeserver ${flags}";
ExecReload = "${pkgs.utillinux}/bin/kill -HUP $MAINPID"; ExecReload = "${pkgs.utillinux}/bin/kill -HUP $MAINPID";
Restart = "on-failure"; Restart = "on-failure";
}; };

View File

@@ -1,6 +1,6 @@
{ matrix-synapse-common-config, { matrix-synapse-common-config,
matrix-lib, matrix-lib,
pluginsEnv, wrapped,
throw', throw',
format format
}: }:
@@ -333,11 +333,6 @@ in {
wantedBy = [ "matrix-synapse.target" ]; wantedBy = [ "matrix-synapse.target" ];
after = [ "matrix-synapse.service" ]; after = [ "matrix-synapse.service" ];
requires = [ "matrix-synapse.service" ]; requires = [ "matrix-synapse.service" ];
environment = {
PYTHONPATH = lib.makeSearchPathOutput "lib" cfg.package.python.sitePackages [
pluginsEnv
];
};
serviceConfig = { serviceConfig = {
Type = "notify"; Type = "notify";
User = "matrix-synapse"; User = "matrix-synapse";
@@ -355,7 +350,7 @@ in {
config-path = [ matrix-synapse-common-config (workerConfig worker) ] ++ cfg.extraConfigFiles; config-path = [ matrix-synapse-common-config (workerConfig worker) ] ++ cfg.extraConfigFiles;
keys-directory = cfg.dataDir; keys-directory = cfg.dataDir;
}; };
in "${cfg.package}/bin/synapse_worker ${flags}"; in "${wrapped}/bin/synapse_worker ${flags}";
}; };
}; };
})); }));