nixpkgs/pkgs/servers/mail/mailman/web.nix
Alyssa Ross 881dd9963f mailman-web: use upstream, improve NixOS module
Previously, some files were copied into the Nixpkgs tree, which meant
we wouldn't easily be able to update them, and was also just messy.

The reason it was done that way before was so that a few NixOS
options could be substituted in.  Some problems with doing it this way
were that the _package_ changed depending on the values of the
settings, which is pretty strange, and also that it only allowed those
few settings to be set.

In the new model, mailman-web is a usable package without needing to
override, and I've implemented the NixOS options in a much more
flexible way.  NixOS' mailman-web config file first reads the
mailman-web settings to use as defaults, but then it loads another
configuration file generated from the new services.mailman.webSettings
option, so _any_ mailman-web Django setting can be customised by the
user, rather than just the three that were supported before.  I've
kept the old options, but there might not really be any good reason to
keep them.
2020-01-30 23:14:45 +00:00

40 lines
1.0 KiB
Nix

{ buildPythonPackage, lib, fetchgit, isPy3k
, git, makeWrapper, sassc, hyperkitty, postorius, whoosh
}:
buildPythonPackage rec {
pname = "mailman-web-unstable";
version = "2019-09-29";
disabled = !isPy3k;
src = fetchgit {
url = "https://gitlab.com/mailman/mailman-web";
rev = "d17203b4d6bdc71c2b40891757f57a32f3de53d5";
sha256 = "124cxr4vfi1ibgxygk4l74q4fysx0a6pga1kk9p5wq2yvzwg9z3n";
leaveDotGit = true;
};
# This is just so people installing from pip also get uwsgi
# installed, AFAICT.
postPatch = ''
sed -i '/^ uwsgi$/d' setup.cfg
'';
nativeBuildInputs = [ git makeWrapper ];
propagatedBuildInputs = [ hyperkitty postorius whoosh ];
# Tries to check runtime configuration.
doCheck = false;
postInstall = ''
wrapProgram $out/bin/mailman-web \
--suffix PATH : ${lib.makeBinPath [ sassc ]}
'';
meta = with lib; {
description = "Django project for Mailman 3 web interface";
license = licenses.gpl3;
maintainers = with maintainers; [ qyliss ];
};
}