Skip to content

Commit 61d15c6

Browse files
nixos/mailman: add option to expand the uwsgi settings
1 parent 6d67443 commit 61d15c6

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";
@@ -570,18 +579,20 @@ in {
570579
};
571580

572581
mailman-uwsgi = lib.mkIf cfg.serve.enable (let
573-
uwsgiConfig.uwsgi = {
574-
type = "normal";
575-
plugins = ["python3"];
576-
home = webEnv;
577-
http = "127.0.0.1:18507";
578-
}
579-
// (if cfg.serve.virtualRoot == "/"
580-
then { module = "mailman_web.wsgi:application"; }
581-
else {
582-
mount = "${cfg.serve.virtualRoot}=mailman_web.wsgi:application";
583-
manage-script-name = true;
582+
uwsgiConfig = lib.recursiveUpdate {
583+
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;
584594
});
595+
} cfg.serve.uwsgiSettings;
585596
uwsgiConfigFile = pkgs.writeText "uwsgi-mailman.json" (builtins.toJSON uwsgiConfig);
586597
in {
587598
wantedBy = ["multi-user.target"];

0 commit comments

Comments
 (0)