about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/mail/mailman/wrapped.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/mail/mailman/wrapped.nix')
-rw-r--r--nixpkgs/pkgs/servers/mail/mailman/wrapped.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/mail/mailman/wrapped.nix b/nixpkgs/pkgs/servers/mail/mailman/wrapped.nix
new file mode 100644
index 000000000000..2a620763d876
--- /dev/null
+++ b/nixpkgs/pkgs/servers/mail/mailman/wrapped.nix
@@ -0,0 +1,20 @@
+{ runCommand, lib, makeWrapper, python3
+, archivers ? [ python3.pkgs.mailman-hyperkitty ]
+}:
+
+let
+  inherit (python3.pkgs) makePythonPath mailman;
+in
+
+runCommand "${mailman.name}-wrapped" {
+  inherit (mailman) meta;
+  buildInputs = [ makeWrapper ];
+  passthru = mailman.passthru // { unwrapped = mailman; };
+} ''
+  mkdir -p "$out/bin"
+  cd "${mailman}/bin"
+  for exe in *; do
+    makeWrapper "${mailman}/bin/$exe" "$out/bin/$exe" \
+        --set PYTHONPATH ${makePythonPath ([ mailman ] ++ archivers)}
+  done
+''