nixos/mailman: create "mailman" executable as a proper wrapper script

This commit is contained in:
Peter Simons 2019-09-11 15:11:34 +02:00
parent 1cb5cff611
commit a7941fe210

View file

@ -6,16 +6,16 @@ let
cfg = config.services.mailman; cfg = config.services.mailman;
mailmanPyEnv = pkgs.python3.withPackages (ps: [ps.mailman ps.mailman-hyperkitty]); mailmanPyEnv = pkgs.python3.withPackages (ps: with ps; [mailman mailman-hyperkitty]);
mailmanExe = with pkgs; stdenv.mkDerivation { mailmanExe = with pkgs; stdenv.mkDerivation {
name = "mailman-" + python3Packages.mailman.version; name = "mailman-" + python3Packages.mailman.version;
buildInputs = [makeWrapper];
unpackPhase = ":"; unpackPhase = ":";
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
sed >"$out/bin/mailman" <"${mailmanPyEnv}/bin/mailman" \ makeWrapper ${mailmanPyEnv}/bin/mailman $out/bin/mailman \
-e "2 iexport MAILMAN_CONFIG_FILE=/etc/mailman.cfg" --set MAILMAN_CONFIG_FILE /etc/mailman.cfg
chmod +x $out/bin/mailman
''; '';
}; };