diff --git a/system/options.nix b/system/options.nix index 65eeda5eb924..7ebe9217ee32 100644 --- a/system/options.nix +++ b/system/options.nix @@ -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 = ""; diff --git a/upstart-jobs/httpd.nix b/upstart-jobs/httpd.nix index c930dcb3caa0..59f08898cffb 100644 --- a/upstart-jobs/httpd.nix +++ b/upstart-jobs/httpd.nix @@ -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