Support organization configuration for subversion

svn path=/nixos/trunk/; revision=8006
This commit is contained in:
Martin Bravenboer 2007-02-22 10:55:58 +00:00
parent 312e3d0e6b
commit 8e6c1ba85d
2 changed files with 39 additions and 2 deletions

View File

@ -578,6 +578,30 @@
"; ";
} }
{
name = ["services" "httpd" "subservices" "subversion" "organization" "name"];
default = null;
description = "
Name of the organization hosting the Subversion service.
";
}
{
name = ["services" "httpd" "subservices" "subversion" "organization" "url"];
default = null;
description = "
URL of the website of the organization hosting the Subversion service.
";
}
{
name = ["services" "httpd" "subservices" "subversion" "organization" "logo"];
default = null;
description = "
Logo the organization hosting the Subversion service.
";
}
{ {
name = ["services" "httpd" "extraSubservices" "enable"]; name = ["services" "httpd" "extraSubservices" "enable"];
default = false; default = false;

View File

@ -5,6 +5,7 @@ let
getCfg = option: config.get ["services" "httpd" option]; getCfg = option: config.get ["services" "httpd" option];
getCfgs = options: config.get (["services" "httpd"] ++ options); 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];
getCfgsSvn = options: config.get (["services" "httpd" "subservices" "subversion"] ++ options);
optional = conf: subService: optional = conf: subService:
if conf then [subService] else []; if conf then [subService] else [];
@ -31,7 +32,7 @@ let
# 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";
dbDir = dataDir + "/db"; dbDir = dataDir + "/db";
distsDir = dataDir + "/dist"; distsDir = dataDir + "/dist";
@ -51,7 +52,19 @@ let
userCreationDomain = getCfgSvn "userCreationDomain"; userCreationDomain = getCfgSvn "userCreationDomain";
inherit pkgs; inherit pkgs;
}) } //
( if getCfgsSvn ["organization" "name"] != null then
{
orgName = getCfgsSvn ["organization" "name"];
orgLogoFile = getCfgsSvn ["organization" "logo"];
orgUrl = getCfgsSvn ["organization" "url"];
}
else
# use the default from the subversion service
{}
)
)
)
) )
++ ++