Skip to content

Commit 1d62a85

Browse files
nixos/mailman: add option to expand the uwsgi settings (#333315)
2 parents 970e93b + 61d15c6 commit 1d62a85

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

nixos/modules/services/mail/mailman.nix

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,15 @@ in {
263263
serve = {
264264
enable = lib.mkEnableOption "automatic nginx and uwsgi setup for mailman-web";
265265

266+
uwsgiSettings = lib.mkOption {
267+
default = { };
268+
example = { uwsgi.buffer-size = 8192; };
269+
inherit (pkgs.formats.json {}) type;
270+
description = ''
271+
Extra configuration to merge into uwsgi config.
272+
'';
273+
};
274+
266275
virtualRoot = lib.mkOption {
267276
default = "/";
268277
example = lib.literalExpression "/lists";
@@ -580,18 +589,20 @@ in {
580589
};
581590

582591
mailman-uwsgi = lib.mkIf cfg.serve.enable (let
583-
uwsgiConfig.uwsgi = {
584-
type = "normal";
585-
plugins = ["python3"];
586-
home = webEnv;
587-
http = "127.0.0.1:18507";
588-
}
589-
// (if cfg.serve.virtualRoot == "/"
590-
then { module = "mailman_web.wsgi:application"; }
591-
else {
592-
mount = "${cfg.serve.virtualRoot}=mailman_web.wsgi:application";
593-
manage-script-name = true;
592+
uwsgiConfig = lib.recursiveUpdate {
593+
uwsgi = {
594+
type = "normal";
595+
plugins = ["python3"];
596+
home = webEnv;
597+
http = "127.0.0.1:18507";
598+
}
599+
// (if cfg.serve.virtualRoot == "/"
600+
then { module = "mailman_web.wsgi:application"; }
601+
else {
602+
mount = "${cfg.serve.virtualRoot}=mailman_web.wsgi:application";
603+
manage-script-name = true;
594604
});
605+
} cfg.serve.uwsgiSettings;
595606
uwsgiConfigFile = pkgs.writeText "uwsgi-mailman.json" (builtins.toJSON uwsgiConfig);
596607
in {
597608
wantedBy = ["multi-user.target"];

0 commit comments

Comments
 (0)