diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-01-09 21:12:59 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-01-09 23:39:36 +0000 |
commit | 3b6b19307af641dbbebc8cea78d38aaf1adf7cc3 (patch) | |
tree | 1888e92c9582cde08bee14d26688363cea0fb6c7 /nixpkgs/pkgs/servers/mail | |
parent | 4b702da513a67b79d2e4dde4df09ff433cd3e606 (diff) | |
download | nixlib-3b6b19307af641dbbebc8cea78d38aaf1adf7cc3.tar nixlib-3b6b19307af641dbbebc8cea78d38aaf1adf7cc3.tar.gz nixlib-3b6b19307af641dbbebc8cea78d38aaf1adf7cc3.tar.bz2 nixlib-3b6b19307af641dbbebc8cea78d38aaf1adf7cc3.tar.lz nixlib-3b6b19307af641dbbebc8cea78d38aaf1adf7cc3.tar.xz nixlib-3b6b19307af641dbbebc8cea78d38aaf1adf7cc3.tar.zst nixlib-3b6b19307af641dbbebc8cea78d38aaf1adf7cc3.zip |
mailman: init package for Mailman CLI
We already had python3Packages.mailman, but that's only really usable as a library. The only other option was to create a whole Python environment, which was undesirable to install as a system-wide package.
Diffstat (limited to 'nixpkgs/pkgs/servers/mail')
-rw-r--r-- | nixpkgs/pkgs/servers/mail/mailman/default.nix | 9 | ||||
-rw-r--r-- | nixpkgs/pkgs/servers/mail/mailman/wrapped.nix | 11 |
2 files changed, 14 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/servers/mail/mailman/default.nix b/nixpkgs/pkgs/servers/mail/mailman/default.nix index 1ba220039ea9..a2b14c50685c 100644 --- a/nixpkgs/pkgs/servers/mail/mailman/default.nix +++ b/nixpkgs/pkgs/servers/mail/mailman/default.nix @@ -27,15 +27,12 @@ buildPythonPackage rec { ''; # 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]) + # them in shell code breaks this assumption. Use the wrapped version (see + # wrapper.nix) if you need the CLI (rather than the Python library). # # 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. + # 'runner' scripts. dontWrapPythonPrograms = true; meta = { diff --git a/nixpkgs/pkgs/servers/mail/mailman/wrapped.nix b/nixpkgs/pkgs/servers/mail/mailman/wrapped.nix new file mode 100644 index 000000000000..1f4a291acc62 --- /dev/null +++ b/nixpkgs/pkgs/servers/mail/mailman/wrapped.nix @@ -0,0 +1,11 @@ +{ mailman, runCommand }: + +runCommand "mailman-wrapped" { + inherit (mailman) meta; + buildInputs = [ mailman.pythonModule.python3.pkgs.wrapPython ]; + passthru = mailman.passthru // { unwrapped = mailman }; +} '' + mkdir -p $out/bin + cp ${mailman}/bin/* $out/bin + wrapPythonProgramsIn $out/bin "${self} $pythonPath" +'' |