* Revert 18115, 18150, 18135, 18112, 18107-18105.
Revert modifications done on apache-httpd configurations. svn path=/nixos/trunk/; revision=18215
This commit is contained in:
parent
ae23b68ee8
commit
e07f1e98db
|
@ -94,8 +94,6 @@
|
||||||
./services/ttys/gpm.nix
|
./services/ttys/gpm.nix
|
||||||
./services/ttys/mingetty.nix
|
./services/ttys/mingetty.nix
|
||||||
./services/web-servers/apache-httpd/default.nix
|
./services/web-servers/apache-httpd/default.nix
|
||||||
./services/web-servers/apache-httpd/per-server-options.nix
|
|
||||||
./services/web-servers/apache-httpd/services.nix
|
|
||||||
./services/web-servers/jboss.nix
|
./services/web-servers/jboss.nix
|
||||||
./services/web-servers/tomcat.nix
|
./services/web-servers/tomcat.nix
|
||||||
./services/x11/desktop-managers/default.nix
|
./services/x11/desktop-managers/default.nix
|
||||||
|
|
|
@ -10,7 +10,7 @@ let
|
||||||
|
|
||||||
httpd = pkgs.apacheHttpd;
|
httpd = pkgs.apacheHttpd;
|
||||||
|
|
||||||
getPort = cfg: cfg.port;
|
getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80;
|
||||||
|
|
||||||
extraModules = attrByPath ["extraModules"] [] mainCfg;
|
extraModules = attrByPath ["extraModules"] [] mainCfg;
|
||||||
extraForeignModules = filter builtins.isAttrs extraModules;
|
extraForeignModules = filter builtins.isAttrs extraModules;
|
||||||
|
@ -33,22 +33,45 @@ let
|
||||||
fullConfig = config; # machine config
|
fullConfig = config; # machine config
|
||||||
};
|
};
|
||||||
|
|
||||||
vhosts = mainCfg.virtualHosts;
|
|
||||||
|
vhostOptions = import ./per-server-options.nix {
|
||||||
|
inherit mkOption;
|
||||||
|
forMainServer = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
vhosts = let
|
||||||
|
makeVirtualHost = cfgIn:
|
||||||
|
let
|
||||||
|
# Fill in defaults for missing options.
|
||||||
|
cfg = addDefaultOptionValues vhostOptions cfgIn;
|
||||||
|
in cfg;
|
||||||
|
in map makeVirtualHost mainCfg.virtualHosts;
|
||||||
|
|
||||||
|
|
||||||
allHosts = [mainCfg] ++ vhosts;
|
allHosts = [mainCfg] ++ vhosts;
|
||||||
|
|
||||||
# !!! This should be replaced by sub-modules to allow non-intrusive
|
|
||||||
# extensions of NixOS.
|
|
||||||
callSubservices = serverInfo: defs:
|
callSubservices = serverInfo: defs:
|
||||||
let f = svc:
|
let f = svc:
|
||||||
rec {
|
let
|
||||||
config =
|
svcFunction =
|
||||||
if res ? options then
|
if svc ? function then svc.function
|
||||||
addDefaultOptionValues res.options svc.configuration
|
else import "${./.}/${if svc ? serviceType then svc.serviceType else svc.serviceName}.nix";
|
||||||
else
|
config = addDefaultOptionValues res.options
|
||||||
svc.configuration;
|
(if svc ? config then svc.config else svc);
|
||||||
res = svc // svc.function {inherit config pkgs serverInfo servicesPath;};
|
defaults = {
|
||||||
}.res;
|
extraConfig = "";
|
||||||
|
extraModules = [];
|
||||||
|
extraModulesPre = [];
|
||||||
|
extraPath = [];
|
||||||
|
extraServerPath = [];
|
||||||
|
globalEnvVars = [];
|
||||||
|
robotsEntries = "";
|
||||||
|
startupScript = "";
|
||||||
|
options = {};
|
||||||
|
};
|
||||||
|
res = defaults // svcFunction {inherit config pkgs serverInfo servicesPath;};
|
||||||
|
in res;
|
||||||
in map f defs;
|
in map f defs;
|
||||||
|
|
||||||
|
|
||||||
|
@ -354,6 +377,13 @@ in
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
default = "";
|
||||||
|
description = "
|
||||||
|
These configuration lines will be passed verbatim to the apache config
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
extraModules = mkOption {
|
extraModules = mkOption {
|
||||||
default = [];
|
default = [];
|
||||||
example = [ "proxy_connect" { name = "php5"; path = "${pkgs.php}/modules/libphp5.so"; } ];
|
example = [ "proxy_connect" { name = "php5"; path = "${pkgs.php}/modules/libphp5.so"; } ];
|
||||||
|
@ -416,8 +446,110 @@ in
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
subservices = {
|
||||||
|
|
||||||
|
# !!! remove this
|
||||||
|
subversion = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "
|
||||||
|
Whether to enable the Subversion subservice in the webserver.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
notificationSender = mkOption {
|
||||||
|
default = "svn-server@example.org";
|
||||||
|
example = "svn-server@example.org";
|
||||||
|
description = "
|
||||||
|
The email address used in the Sender field of commit
|
||||||
|
notification messages sent by the Subversion subservice.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
userCreationDomain = mkOption {
|
||||||
|
default = "example.org";
|
||||||
|
example = "example.org";
|
||||||
|
description = "
|
||||||
|
The domain from which user creation is allowed. A client can
|
||||||
|
only create a new user account if its IP address resolves to
|
||||||
|
this domain.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
autoVersioning = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "
|
||||||
|
Whether you want the Subversion subservice to support
|
||||||
|
auto-versioning, which enables Subversion repositories to be
|
||||||
|
mounted as read/writable file systems on operating systems that
|
||||||
|
support WebDAV.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
default = "/no/such/path/exists";
|
||||||
|
description = "
|
||||||
|
Place to put SVN repository.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
organization = {
|
||||||
|
|
||||||
|
name = mkOption {
|
||||||
|
default = null;
|
||||||
|
description = "
|
||||||
|
Name of the organization hosting the Subversion service.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
url = mkOption {
|
||||||
|
default = null;
|
||||||
|
description = "
|
||||||
|
URL of the website of the organization hosting the Subversion service.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
logo = mkOption {
|
||||||
|
default = null;
|
||||||
|
description = "
|
||||||
|
Logo the organization hosting the Subversion service.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Include the options shared between the main server and virtual hosts.
|
||||||
|
// (import ./per-server-options.nix {
|
||||||
|
inherit mkOption;
|
||||||
|
forMainServer = true;
|
||||||
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,18 +3,9 @@
|
||||||
# has additional options that affect the web server as a whole, like
|
# has additional options that affect the web server as a whole, like
|
||||||
# the user/group to run under.)
|
# the user/group to run under.)
|
||||||
|
|
||||||
{options, config, pkgs, ...}:
|
{forMainServer, mkOption}:
|
||||||
|
|
||||||
let
|
{
|
||||||
inherit (pkgs.lib) mkOption addDefaultOptionValues types;
|
|
||||||
|
|
||||||
mainServerArgs = {
|
|
||||||
config = config.services.httpd;
|
|
||||||
options = options.services.httpd;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
perServerOptions = {forMainServer}: {config, ...}: {
|
|
||||||
|
|
||||||
hostName = mkOption {
|
hostName = mkOption {
|
||||||
default = "localhost";
|
default = "localhost";
|
||||||
|
@ -32,12 +23,10 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
default = if config.enableSSL then 443 else 80;
|
default = 0;
|
||||||
type = with types; uniq int;
|
|
||||||
description = "
|
description = "
|
||||||
Port for the server. The default port depends on the
|
Port for the server. 0 means use the default port: 80 for http
|
||||||
<option>enableSSL</option> option of this server. (80 for http and
|
and 443 for https (i.e. when enableSSL is set).
|
||||||
443 for https).
|
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -122,6 +111,13 @@ let
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraSubservices = mkOption {
|
||||||
|
default = [];
|
||||||
|
description = "
|
||||||
|
Extra subservices to enable in the webserver.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
enableUserDir = mkOption {
|
enableUserDir = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "
|
description = "
|
||||||
|
@ -139,44 +135,4 @@ let
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
vhostOptions = perServerOptions {
|
|
||||||
forMainServer = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
services.httpd = {
|
|
||||||
|
|
||||||
virtualHosts = mkOption {
|
|
||||||
default = [];
|
|
||||||
example = [
|
|
||||||
{ hostName = "foo";
|
|
||||||
documentRoot = "/data/webroot-foo";
|
|
||||||
}
|
|
||||||
{ hostName = "bar";
|
|
||||||
documentRoot = "/data/webroot-bar";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
type = with types; listOf optionSet;
|
|
||||||
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.
|
|
||||||
'';
|
|
||||||
|
|
||||||
options = [
|
|
||||||
vhostOptions
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
// perServerOptions {forMainServer = true;} mainServerArgs
|
|
||||||
;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,129 +0,0 @@
|
||||||
{options, config, pkgs, ...}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (pkgs.lib) mkOption addDefaultOptionValues types;
|
|
||||||
|
|
||||||
mainServerArgs = {
|
|
||||||
config = config.services.httpd;
|
|
||||||
options = options.services.httpd;
|
|
||||||
};
|
|
||||||
|
|
||||||
subServiceOptions = {options, config, ...}: {
|
|
||||||
options = {
|
|
||||||
|
|
||||||
extraConfig = mkOption {
|
|
||||||
default = "";
|
|
||||||
description = "Not documented yet.";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraModules = mkOption {
|
|
||||||
default = [];
|
|
||||||
description = "Not documented yet.";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraModulesPre = mkOption {
|
|
||||||
default = [];
|
|
||||||
description = "Not documented yet.";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraPath = mkOption {
|
|
||||||
default = [];
|
|
||||||
description = "Not documented yet.";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraServerPath = mkOption {
|
|
||||||
default = [];
|
|
||||||
description = "Not documented yet.";
|
|
||||||
};
|
|
||||||
|
|
||||||
globalEnvVars = mkOption {
|
|
||||||
default = [];
|
|
||||||
description = "Not documented yet.";
|
|
||||||
};
|
|
||||||
|
|
||||||
robotsEntries = mkOption {
|
|
||||||
default = "";
|
|
||||||
description = "Not documented yet.";
|
|
||||||
};
|
|
||||||
|
|
||||||
startupScript = mkOption {
|
|
||||||
default = "";
|
|
||||||
description = "Not documented yet.";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
serviceType = mkOption {
|
|
||||||
description = "Obsolete name of <option>serviceName</option>.";
|
|
||||||
# serviceType is the old name of serviceName.
|
|
||||||
apply = x: config.serviceName;
|
|
||||||
};
|
|
||||||
|
|
||||||
serviceName = mkOption {
|
|
||||||
example = "trac";
|
|
||||||
description = "
|
|
||||||
(Deprecated)
|
|
||||||
|
|
||||||
Identify a service by the name of the file containing it. The
|
|
||||||
service expression is contained inside
|
|
||||||
<filename>./modules/services/web-servers/apache-httpd</filename>
|
|
||||||
directory.
|
|
||||||
|
|
||||||
Due to lack of documentation, this option will be replaced by
|
|
||||||
enable flags.
|
|
||||||
";
|
|
||||||
|
|
||||||
# serviceName is the new name of serviceType.
|
|
||||||
extraConfigs = map (def: def.value) options.serviceType.definitions;
|
|
||||||
};
|
|
||||||
|
|
||||||
function = mkOption {
|
|
||||||
default = null;
|
|
||||||
description = "
|
|
||||||
(Deprecated) Add a function which configure the current sub-service.
|
|
||||||
";
|
|
||||||
apply = f:
|
|
||||||
if isNull f then
|
|
||||||
import "${./.}/${config.serviceName}.nix"
|
|
||||||
else
|
|
||||||
f;
|
|
||||||
};
|
|
||||||
|
|
||||||
configuration = mkOption {
|
|
||||||
default = {};
|
|
||||||
description = "
|
|
||||||
(Deprecated) Define option values of the current sub-service.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
perServerOptions = {config, ...}: {
|
|
||||||
|
|
||||||
extraSubservices = mkOption {
|
|
||||||
default = [];
|
|
||||||
type = with types; listOf optionSet;
|
|
||||||
description = "
|
|
||||||
Extra subservices to enable in the webserver.
|
|
||||||
";
|
|
||||||
options = [ subServiceOptions ];
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
services.httpd = {
|
|
||||||
|
|
||||||
virtualHosts = mkOption {
|
|
||||||
options = [ perServerOptions ];
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
// perServerOptions mainServerArgs
|
|
||||||
;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -56,11 +56,9 @@ rec {
|
||||||
services.httpd.adminAddr = "e.dolstra@tudelft.nl";
|
services.httpd.adminAddr = "e.dolstra@tudelft.nl";
|
||||||
services.httpd.extraSubservices =
|
services.httpd.extraSubservices =
|
||||||
[ { serviceType = "subversion";
|
[ { serviceType = "subversion";
|
||||||
configuration = {
|
|
||||||
urlPrefix = "";
|
urlPrefix = "";
|
||||||
dataDir = "/data/subversion";
|
dataDir = "/data/subversion";
|
||||||
userCreationDomain = "192.168.0.0/16";
|
userCreationDomain = "192.168.0.0/16";
|
||||||
};
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
nixpkgs.config.packageOverrides = overrides;
|
nixpkgs.config.packageOverrides = overrides;
|
||||||
|
|
Loading…
Reference in a new issue