From eeee6ea1e2593b669aa944fdbe5922a7390de023 Mon Sep 17 00:00:00 2001 From: Martin Bravenboer Date: Tue, 20 Feb 2007 15:11:49 +0000 Subject: [PATCH] added configuration option for extraSubservices, which allows you to plugin an arbitrary service into the webserver. svn path=/nixos/trunk/; revision=7926 --- system/options.nix | 17 ++++++++++++++++- upstart-jobs/httpd.nix | 12 +++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/system/options.nix b/system/options.nix index 65eeda5eb92..7ebe9217ee3 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 c930dcb3caa..59f08898cff 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