diff options
author | zimbatm <zimbatm@zimbatm.com> | 2020-06-09 23:54:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-09 23:54:54 +0200 |
commit | 9494fdeeb323e3f969eaab717dd9b9d6b7524378 (patch) | |
tree | 40e15f19f0dc533a88d2a1a7ea3f6bffb1212965 /pkgs/servers/matrix-synapse | |
parent | 168846fa8ec3a4649aefdc7cea9b7a65e5270ece (diff) | |
parent | cd92184f3de50335c54cec707c5fa9a40e50a3f4 (diff) |
Merge pull request #70327 from abbradar/synapse-plugins
Refactor Synapse plugins, add matrix-synapse-pam
Diffstat (limited to 'pkgs/servers/matrix-synapse')
-rw-r--r-- | pkgs/servers/matrix-synapse/default.nix | 27 | ||||
-rw-r--r-- | pkgs/servers/matrix-synapse/plugins/default.nix | 6 | ||||
-rw-r--r-- | pkgs/servers/matrix-synapse/plugins/ldap3.nix | 17 | ||||
-rw-r--r-- | pkgs/servers/matrix-synapse/plugins/pam.nix | 15 |
4 files changed, 45 insertions, 20 deletions
diff --git a/pkgs/servers/matrix-synapse/default.nix b/pkgs/servers/matrix-synapse/default.nix index d2c1afa0e7ca..15df735b7072 100644 --- a/pkgs/servers/matrix-synapse/default.nix +++ b/pkgs/servers/matrix-synapse/default.nix @@ -5,23 +5,9 @@ with python3.pkgs; let - matrix-synapse-ldap3 = buildPythonPackage rec { - pname = "matrix-synapse-ldap3"; - version = "0.1.4"; - - src = fetchPypi { - inherit pname version; - sha256 = "01bms89sl16nyh9f141idsz4mnhxvjrc3gj721wxh1fhikps0djx"; - }; - - propagatedBuildInputs = [ service-identity ldap3 twisted ]; - - # ldaptor is not ready for py3 yet - doCheck = !isPy3k; - checkInputs = [ ldaptor mock ]; - }; - -in buildPythonApplication rec { + plugins = python3.pkgs.callPackage ./plugins { }; +in +buildPythonApplication rec { pname = "matrix-synapse"; version = "1.14.0"; @@ -45,7 +31,6 @@ in buildPythonApplication rec { jinja2 jsonschema lxml - matrix-synapse-ldap3 msgpack netaddr phonenumbers @@ -79,12 +64,14 @@ in buildPythonApplication rec { doCheck = !stdenv.isDarwin; - passthru.tests = { inherit (nixosTests) matrix-synapse; }; - checkPhase = '' PYTHONPATH=".:$PYTHONPATH" ${python3.interpreter} -m twisted.trial tests ''; + passthru.tests = { inherit (nixosTests) matrix-synapse; }; + passthru.plugins = plugins; + passthru.python = python3; + meta = with stdenv.lib; { homepage = "https://matrix.org"; description = "Matrix reference homeserver"; diff --git a/pkgs/servers/matrix-synapse/plugins/default.nix b/pkgs/servers/matrix-synapse/plugins/default.nix new file mode 100644 index 000000000000..f3dbaa1573f0 --- /dev/null +++ b/pkgs/servers/matrix-synapse/plugins/default.nix @@ -0,0 +1,6 @@ +{ callPackage }: + +{ + matrix-synapse-ldap3 = callPackage ./ldap3.nix { }; + matrix-synapse-pam = callPackage ./pam.nix { }; +} diff --git a/pkgs/servers/matrix-synapse/plugins/ldap3.nix b/pkgs/servers/matrix-synapse/plugins/ldap3.nix new file mode 100644 index 000000000000..9f1aec20033b --- /dev/null +++ b/pkgs/servers/matrix-synapse/plugins/ldap3.nix @@ -0,0 +1,17 @@ +{ isPy3k, buildPythonPackage, fetchPypi, service-identity, ldap3, twisted, ldaptor, mock }: + +buildPythonPackage rec { + pname = "matrix-synapse-ldap3"; + version = "0.1.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "01bms89sl16nyh9f141idsz4mnhxvjrc3gj721wxh1fhikps0djx"; + }; + + propagatedBuildInputs = [ service-identity ldap3 twisted ]; + + # ldaptor is not ready for py3 yet + doCheck = !isPy3k; + checkInputs = [ ldaptor mock ]; +} diff --git a/pkgs/servers/matrix-synapse/plugins/pam.nix b/pkgs/servers/matrix-synapse/plugins/pam.nix new file mode 100644 index 000000000000..47ee28a7794c --- /dev/null +++ b/pkgs/servers/matrix-synapse/plugins/pam.nix @@ -0,0 +1,15 @@ +{ buildPythonPackage, fetchFromGitHub, twisted, python-pam }: + +buildPythonPackage rec { + pname = "matrix-synapse-pam"; + version = "0.1.2"; + + src = fetchFromGitHub { + owner = "14mRh4X0r"; + repo = "matrix-synapse-pam"; + rev = "v${version}"; + sha256 = "10byma9hxz3g4sirw5sa4pvljn83h9vs7zc15chhpl2n14bdx45l"; + }; + + propagatedBuildInputs = [ twisted python-pam ]; +} |