@@ -0,0 +1,32 @@
1+{ lib, buildPythonPackage, fetchFromGitHub, matrix-synapse }:
2+
3+buildPythonPackage rec {
4+ pname = "matrix-synapse-mjolnir-antispam";
5+ version = "0.1.17";
6+
7+ src = fetchFromGitHub {
8+ owner = "matrix-org";
9+ repo = "mjolnir";
10+ rev = "v${version}";
11+ sha256 = "sha256-uBI5AllXWgl3eL60WZ/j11Tt7QpY7CKcmFQOU74/Qjs=";
12+ };
13+
14+ sourceRoot = "./source/synapse_antispam";
15+
16+ propagatedBuildInputs = [ matrix-synapse ];
17+
18+ doCheck = false; # no tests
19+ pythonImportsCheck = [ "mjolnir" ];
20+
21+ meta = with lib; {
22+ description = "AntiSpam / Banlist plugin to be used with mjolnir";
23+ longDescription = ''
24+ Primarily meant to block invites from undesired homeservers/users,
25+ Mjolnir's Synapse module is a way to interpret ban lists and apply
26+ them to your entire homeserver.
27+ '';
28+ homepage = "https://github.com/matrix-org/mjolnir#synapse-module";
29+ license = licenses.asl20;
30+ maintainers = with maintainers; [ jojosch ];
31+ };
32+}