added configuration option for extraSubservices, which allows you to plugin an arbitrary service into the webserver.
svn path=/nixos/trunk/; revision=7926
This commit is contained in:
parent
ef8e5716cb
commit
eeee6ea1e2
2 changed files with 25 additions and 4 deletions
|
@ -578,7 +578,22 @@
|
|||
";
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
name = ["services" "httpd" "extraSubservices" "enable"];
|
||||
default = false;
|
||||
description = "
|
||||
Whether to enable the extra subservices in the webserver.
|
||||
";
|
||||
}
|
||||
|
||||
{
|
||||
name = ["services" "httpd" "extraSubservices" "services"];
|
||||
default = false;
|
||||
description = "
|
||||
Extra subservices to enable in the webserver.
|
||||
";
|
||||
}
|
||||
|
||||
{
|
||||
name = ["installer" "nixpkgsURL"];
|
||||
default = "";
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
let
|
||||
|
||||
getCfg = option: config.get ["services" "httpd" option];
|
||||
getCfgs = options: config.get (["services" "httpd"] ++ options);
|
||||
getCfgSvn = option: config.get ["services" "httpd" "subservices" "subversion" option];
|
||||
|
||||
optional = conf: subService:
|
||||
|
@ -29,7 +30,7 @@ let
|
|||
subServices =
|
||||
|
||||
# The Subversion subservice.
|
||||
optional (getCfgSvn "enable") (
|
||||
(optional (getCfgSvn "enable") (
|
||||
let dataDir = getCfgSvn "dataDir"; in
|
||||
import ../services/subversion {
|
||||
reposDir = dataDir + "/repos";
|
||||
|
@ -52,10 +53,15 @@ let
|
|||
|
||||
inherit pkgs;
|
||||
})
|
||||
|
||||
)
|
||||
++
|
||||
|
||||
(optional (getCfgs ["extraSubservices" "enable"]) (
|
||||
(getCfgs ["extraSubservices" "services"]) webServer pkgs
|
||||
)
|
||||
)
|
||||
;
|
||||
};
|
||||
|
||||
|
||||
in
|
||||
|
||||
|
|
Loading…
Reference in a new issue