mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-21 04:28:40 +03:00
Merge pull request #189756 from alyssais/mailman-virtualRoot
nixos/mailman: add serve.virtualRoot option
This commit is contained in:
commit
91d7b27cfb
@ -263,6 +263,15 @@ in {
|
|||||||
|
|
||||||
serve = {
|
serve = {
|
||||||
enable = mkEnableOption (lib.mdDoc "Automatic nginx and uwsgi setup for mailman-web");
|
enable = mkEnableOption (lib.mdDoc "Automatic nginx and uwsgi setup for mailman-web");
|
||||||
|
|
||||||
|
virtualRoot = mkOption {
|
||||||
|
default = "/";
|
||||||
|
example = lib.literalExpression "/lists";
|
||||||
|
type = types.str;
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Path to mount the mailman-web django application on.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extraPythonPackages = mkOption {
|
extraPythonPackages = mkOption {
|
||||||
@ -433,8 +442,8 @@ in {
|
|||||||
enable = mkDefault true;
|
enable = mkDefault true;
|
||||||
virtualHosts = lib.genAttrs cfg.webHosts (webHost: {
|
virtualHosts = lib.genAttrs cfg.webHosts (webHost: {
|
||||||
locations = {
|
locations = {
|
||||||
"/".extraConfig = "uwsgi_pass unix:/run/mailman-web.socket;";
|
${cfg.serve.virtualRoot}.extraConfig = "uwsgi_pass unix:/run/mailman-web.socket;";
|
||||||
"/static/".alias = webSettings.STATIC_ROOT + "/";
|
"${cfg.serve.virtualRoot}/static/".alias = webSettings.STATIC_ROOT + "/";
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -561,7 +570,8 @@ in {
|
|||||||
type = "normal";
|
type = "normal";
|
||||||
plugins = ["python3"];
|
plugins = ["python3"];
|
||||||
home = webEnv;
|
home = webEnv;
|
||||||
module = "mailman_web.wsgi";
|
manage-script-name = true;
|
||||||
|
mount = "${cfg.serve.virtualRoot}=mailman_web.wsgi:application";
|
||||||
http = "127.0.0.1:18507";
|
http = "127.0.0.1:18507";
|
||||||
};
|
};
|
||||||
uwsgiConfigFile = pkgs.writeText "uwsgi-mailman.json" (builtins.toJSON uwsgiConfig);
|
uwsgiConfigFile = pkgs.writeText "uwsgi-mailman.json" (builtins.toJSON uwsgiConfig);
|
||||||
|
Loading…
Reference in New Issue
Block a user