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:
Martin Bravenboer 2007-02-20 15:11:49 +00:00
parent ef8e5716cb
commit eeee6ea1e2
2 changed files with 25 additions and 4 deletions

View file

@ -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 = "";

View file

@ -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