summary refs log tree commit diff
path: root/pkgs/servers/mail/mailman/core.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/mail/mailman/core.nix')
-rw-r--r--pkgs/servers/mail/mailman/core.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/servers/mail/mailman/core.nix b/pkgs/servers/mail/mailman/core.nix
new file mode 100644
index 00000000000..fcd594270db
--- /dev/null
+++ b/pkgs/servers/mail/mailman/core.nix
@@ -0,0 +1,42 @@
+{ stdenv, buildPythonPackage, fetchPypi, alembic, aiosmtpd, dnspython
+, flufl_bounce, flufl_i18n, flufl_lock, lazr_config, lazr_delegates, passlib
+, requests, zope_configuration, click, falcon, importlib-resources
+, zope_component
+}:
+
+buildPythonPackage rec {
+  pname = "mailman";
+  version = "3.2.2";
+
+  patches = [ ./0001-Find-external-tools-via-PATH-rather-than-hard-coding.patch ];
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "09s9p5pb8gff6zblwidyq830yfgcvv50p5drdaxj1qpy8w46lvc6";
+  };
+
+  propagatedBuildInputs = [
+    alembic aiosmtpd click dnspython falcon flufl_bounce flufl_i18n flufl_lock
+    importlib-resources lazr_config passlib requests zope_configuration
+    zope_component
+  ];
+
+  # Mailman assumes that those scripts in $out/bin are Python scripts. Wrapping
+  # them in shell code breaks this assumption. The proper way to use mailman is
+  # to create a specialized python interpreter:
+  #
+  #   python37.withPackages (ps: [ps.mailman])
+  #
+  # This gives a properly wrapped 'mailman' command plus an interpreter that
+  # has all the necessary search paths to execute unwrapped 'master' and
+  # 'runner' scripts. The setup is a little tricky, but fortunately NixOS is
+  # about to get a OS module that takes care of those details.
+  dontWrapPythonPrograms = true;
+
+  meta = {
+    homepage = https://www.gnu.org/software/mailman/;
+    description = "Free software for managing electronic mail discussion and newsletter lists";
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = with stdenv.lib.maintainers; [ peti ];
+  };
+}