1{
2 lib,
3 python3,
4 fetchPypi,
5 sassc,
6 hyperkitty,
7 postorius,
8 nixosTests,
9}:
10
11with python3.pkgs;
12
13buildPythonPackage rec {
14 pname = "mailman_web";
15 version = "0.0.9";
16 disabled = pythonOlder "3.8";
17 pyproject = true;
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-3wnduej6xMQzrjGhGXQznfJud/Uoy3BDduukRJeahL8=";
22 };
23
24 postPatch = ''
25 # Upstream seems to mostly target installing on top of existing
26 # distributions, and uses a path appropriate for that, but we are
27 # a distribution, so use a state directory appropriate for a
28 # distro package.
29 substituteInPlace mailman_web/settings/base.py \
30 --replace-fail /opt/mailman/web /var/lib/mailman-web
31 '';
32
33 nativeBuildInputs = [ pdm-backend ];
34 propagatedBuildInputs = [
35 hyperkitty
36 postorius
37 whoosh
38 ];
39
40 # Tries to check runtime configuration.
41 doCheck = false;
42
43 makeWrapperArgs = [
44 "--suffix PATH : ${lib.makeBinPath [ sassc ]}"
45 ];
46
47 passthru.tests = { inherit (nixosTests) mailman; };
48
49 meta = with lib; {
50 homepage = "https://gitlab.com/mailman/mailman-web";
51 description = "Django project for Mailman 3 web interface";
52 mainProgram = "mailman-web";
53 license = licenses.gpl3Plus;
54 maintainers = with maintainers; [
55 qyliss
56 m1cr0man
57 ];
58 };
59}