nixpkgs/pkgs/servers/mail/mailman/wrapped.nix
Alyssa Ross a8538a73a7 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.
2020-01-30 23:14:45 +00:00

21 lines
512 B
Nix

{ 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
''