nixos/mailman: add support for the Mailman Web UI (Postorius & Hyperkitty)

This commit is contained in:
Peter Simons
2019-09-11 12:19:23 +02:00
parent 14854f20bb
commit 72c7ba5aba
6 changed files with 776 additions and 9 deletions
+27
View File
@@ -0,0 +1,27 @@
{ stdenv
, serverEMail ? "postmaster@example.org"
, archiverKey ? "SecretArchiverAPIKey"
, allowedHosts ? []
}:
let
allowedHostsString = stdenv.lib.concatMapStringsSep ", " (x: "\""+x+"\"") allowedHosts;
in
stdenv.mkDerivation {
name = "mailman-web-0";
unpackPhase = ":";
installPhase = ''
install -D -m 444 ${./urls.py} $out/urls.py
install -D -m 444 ${./wsgi.py} $out/wsgi.py
substitute ${./settings.py} $out/settings.py \
--subst-var-by SERVER_EMAIL '${serverEMail}' \
--subst-var-by ARCHIVER_KEY '${archiverKey}' \
--subst-var-by ALLOWED_HOSTS '${allowedHostsString}'
chmod 444 $out/settings.py
'';
}