2020-04-24 23:36:52 +00:00
|
|
|
{ lib, stdenv, python3, openssl
|
|
|
|
, enableSystemd ? stdenv.isLinux, nixosTests
|
2021-10-04 12:37:57 +00:00
|
|
|
, enableRedis ? true
|
2020-12-25 13:55:36 +00:00
|
|
|
, callPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
let
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
frozendict = super.frozendict.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.2";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "0ibf1wipidz57giy53dh7mh68f2hz38x8f4wdq88mvxj5pr7jhbp";
|
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
with py.pkgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-09-18 10:52:07 +00:00
|
|
|
plugins = py.pkgs.callPackage ./plugins { };
|
2020-12-25 13:55:36 +00:00
|
|
|
tools = callPackage ./tools { };
|
2020-06-18 07:06:33 +00:00
|
|
|
in
|
|
|
|
buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "matrix-synapse";
|
2021-10-09 14:59:57 +00:00
|
|
|
version = "1.44.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-10-09 14:59:57 +00:00
|
|
|
sha256 = "sha256-oH8FXHSa120/Fys21UJfAAFPehJxEbQ8Op98PYkK8dE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-08-18 13:19:15 +00:00
|
|
|
./0001-setup-add-homeserver-as-console-script.patch
|
2021-10-09 14:59:57 +00:00
|
|
|
./0002-Expose-generic-worker-as-binary-under-NixOS.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [ openssl ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-06-04 09:07:49 +00:00
|
|
|
authlib
|
2020-04-24 23:36:52 +00:00
|
|
|
bcrypt
|
|
|
|
bleach
|
|
|
|
canonicaljson
|
|
|
|
daemonize
|
|
|
|
frozendict
|
2021-06-04 09:07:49 +00:00
|
|
|
ijson
|
2020-04-24 23:36:52 +00:00
|
|
|
jinja2
|
|
|
|
jsonschema
|
|
|
|
lxml
|
|
|
|
msgpack
|
|
|
|
netaddr
|
|
|
|
phonenumbers
|
|
|
|
pillow
|
2021-08-27 14:25:00 +00:00
|
|
|
prometheus-client
|
2020-04-24 23:36:52 +00:00
|
|
|
psutil
|
|
|
|
psycopg2
|
|
|
|
pyasn1
|
2021-06-04 09:07:49 +00:00
|
|
|
pyjwt
|
2020-04-24 23:36:52 +00:00
|
|
|
pymacaroons
|
|
|
|
pynacl
|
|
|
|
pyopenssl
|
|
|
|
pysaml2
|
|
|
|
pyyaml
|
|
|
|
requests
|
2021-06-04 09:07:49 +00:00
|
|
|
setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
signedjson
|
|
|
|
sortedcontainers
|
|
|
|
treq
|
|
|
|
twisted
|
|
|
|
typing-extensions
|
2021-06-04 09:07:49 +00:00
|
|
|
unpaddedbase64
|
2020-11-03 02:18:15 +00:00
|
|
|
] ++ lib.optional enableSystemd systemd
|
2021-06-28 23:13:55 +00:00
|
|
|
++ lib.optionals enableRedis [ hiredis txredisapi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = [ mock parameterized openssl ];
|
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
|
|
|
checkPhase = ''
|
2021-09-22 15:38:15 +00:00
|
|
|
PYTHONPATH=".:$PYTHONPATH" ${py.interpreter} -m twisted.trial -j $NIX_BUILD_CORES tests
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) matrix-synapse; };
|
|
|
|
passthru.plugins = plugins;
|
2020-12-25 13:55:36 +00:00
|
|
|
passthru.tools = tools;
|
2021-09-18 10:52:07 +00:00
|
|
|
passthru.python = py;
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://matrix.org";
|
|
|
|
description = "Matrix reference homeserver";
|
|
|
|
license = licenses.asl20;
|
2020-06-18 07:06:33 +00:00
|
|
|
maintainers = teams.matrix.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|