1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-07 19:15:36 +03:00

* Convert per-server-options into a module.

svn path=/nixos/trunk/; revision=18105
This commit is contained in:
Nicolas Pierron 2009-11-04 17:00:42 +00:00
parent 46558b31a0
commit 063224bc84
3 changed files with 54 additions and 49 deletions

View file

@ -3,8 +3,13 @@
# has additional options that affect the web server as a whole, like
# the user/group to run under.)
{forMainServer, mkOption}:
{config, pkgs, ...}:
let
inherit (pkgs.lib) mkOption addDefaultOptionValues;
perServerOptions = {forMainServer}:
# !!! The following have to be re-indent later.
{
hostName = mkOption {
@ -135,4 +140,46 @@
";
};
}
};
vhostOptions = perServerOptions {
forMainServer = false;
};
in
{
options = {
services.httpd = {
virtualHosts = mkOption {
default = [];
example = [
{ hostName = "foo";
documentRoot = "/data/webroot-foo";
}
{ hostName = "bar";
documentRoot = "/data/webroot-bar";
}
];
description = ''
Specification of the virtual hosts served by Apache. Each
element should be an attribute set specifying the
configuration of the virtual host. The available options
are the non-global options permissible for the main host.
'';
# Add the default value for each function which is not defined.
# This should be replaced by sub-modules.
apply =
map (vhost:
addDefaultOptionValues vhostOptions vhost
);
};
}
// perServerOptions {forMainServer = true;}
;
};
}