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
@ -578,6 +578,21 @@
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
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"];
|
name = ["installer" "nixpkgsURL"];
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
let
|
let
|
||||||
|
|
||||||
getCfg = option: config.get ["services" "httpd" option];
|
getCfg = option: config.get ["services" "httpd" option];
|
||||||
|
getCfgs = options: config.get (["services" "httpd"] ++ options);
|
||||||
getCfgSvn = option: config.get ["services" "httpd" "subservices" "subversion" option];
|
getCfgSvn = option: config.get ["services" "httpd" "subservices" "subversion" option];
|
||||||
|
|
||||||
optional = conf: subService:
|
optional = conf: subService:
|
||||||
@ -29,7 +30,7 @@ let
|
|||||||
subServices =
|
subServices =
|
||||||
|
|
||||||
# The Subversion subservice.
|
# The Subversion subservice.
|
||||||
optional (getCfgSvn "enable") (
|
(optional (getCfgSvn "enable") (
|
||||||
let dataDir = getCfgSvn "dataDir"; in
|
let dataDir = getCfgSvn "dataDir"; in
|
||||||
import ../services/subversion {
|
import ../services/subversion {
|
||||||
reposDir = dataDir + "/repos";
|
reposDir = dataDir + "/repos";
|
||||||
@ -52,11 +53,16 @@ let
|
|||||||
|
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
})
|
})
|
||||||
|
)
|
||||||
|
++
|
||||||
|
|
||||||
|
(optional (getCfgs ["extraSubservices" "enable"]) (
|
||||||
|
(getCfgs ["extraSubservices" "services"]) webServer pkgs
|
||||||
|
)
|
||||||
|
)
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user