* Added a subservices for the Zabbix PHP frontend.
* Apache subservices: missing declarations are filled in with defaults. svn path=/nixos/trunk/; revision=12022
This commit is contained in:
parent
0b068f504c
commit
deaf99ca92
@ -1989,7 +1989,7 @@
|
|||||||
authentication = mkOption {
|
authentication = mkOption {
|
||||||
default = ''
|
default = ''
|
||||||
# Generated file; do not edit!
|
# Generated file; do not edit!
|
||||||
local all all ident sameuser
|
local all all ident sameuser
|
||||||
host all all 127.0.0.1/32 md5
|
host all all 127.0.0.1/32 md5
|
||||||
host all all ::1/128 md5
|
host all all ::1/128 md5
|
||||||
'';
|
'';
|
||||||
|
@ -55,7 +55,18 @@ let
|
|||||||
if svc ? function then svc.function
|
if svc ? function then svc.function
|
||||||
else import (./noDir/.. + ("/" + svc.serviceName + ".nix"));
|
else import (./noDir/.. + ("/" + svc.serviceName + ".nix"));
|
||||||
config = addDefaultOptionValues res.options svc.config;
|
config = addDefaultOptionValues res.options svc.config;
|
||||||
res = svcFunction {inherit config pkgs serverInfo;};
|
defaults = {
|
||||||
|
extraConfig = "";
|
||||||
|
extraModules = [];
|
||||||
|
extraModulesPre = [];
|
||||||
|
extraPath = [];
|
||||||
|
extraServerPath = [];
|
||||||
|
globalEnvVars = [];
|
||||||
|
robotsEntries = "";
|
||||||
|
startupScript = "";
|
||||||
|
options = {};
|
||||||
|
};
|
||||||
|
res = defaults // svcFunction {inherit config pkgs serverInfo;};
|
||||||
in res;
|
in res;
|
||||||
in map f defs;
|
in map f defs;
|
||||||
|
|
||||||
|
@ -111,15 +111,4 @@ in {
|
|||||||
Disallow: /pt/bin/
|
Disallow: /pt/bin/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# !!! should not be needed
|
|
||||||
extraModulesPre = [];
|
|
||||||
extraModules = [];
|
|
||||||
globalEnvVars = [];
|
|
||||||
extraServerPath = [];
|
|
||||||
extraPath = [];
|
|
||||||
startupScript = null;
|
|
||||||
|
|
||||||
options = {
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
58
upstart-jobs/apache-httpd/zabbix.nix
Normal file
58
upstart-jobs/apache-httpd/zabbix.nix
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
{config, pkgs, serverInfo}:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
# The Zabbix PHP frontend needs to be able to write its
|
||||||
|
# configuration settings (the connection info to the database) to
|
||||||
|
# the "conf" subdirectory. So symlink $out/conf to some directory
|
||||||
|
# outside of the Nix store where we want to keep this stateful info.
|
||||||
|
# Note that different instances of the frontend will therefore end
|
||||||
|
# up with their own copies of the PHP sources. !!! Alternatively,
|
||||||
|
# we could generate zabbix.conf.php declaratively.
|
||||||
|
zabbixPHP = pkgs.runCommand "${pkgs.zabbixServer.name}-php" {} ''
|
||||||
|
cp -rs ${pkgs.zabbixServer}/share/zabbix/php $out
|
||||||
|
chmod -R u+w $out
|
||||||
|
#rm -rf $out/conf
|
||||||
|
ln -s ${config.stateDir}/zabbix.conf.php $out/conf/zabbix.conf.php
|
||||||
|
'';
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
Alias ${config.urlPrefix}/ ${zabbixPHP}/
|
||||||
|
|
||||||
|
<Directory ${zabbixPHP}>
|
||||||
|
DirectoryIndex index.php
|
||||||
|
Order deny,allow
|
||||||
|
Allow from *
|
||||||
|
</Directory>
|
||||||
|
'';
|
||||||
|
|
||||||
|
startupScript = pkgs.writeScript "zabbix-startup-hook" ''
|
||||||
|
mkdir -p ${config.stateDir}
|
||||||
|
chown -R ${serverInfo.serverConfig.user} ${config.stateDir}
|
||||||
|
'';
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
urlPrefix = pkgs.lib.mkOption {
|
||||||
|
default = "/zabbix";
|
||||||
|
description = "
|
||||||
|
The URL prefix under which the Zabbix service appears.
|
||||||
|
Use the empty string to have it appear in the server root.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
stateDir = pkgs.lib.mkOption {
|
||||||
|
default = "/var/lib/zabbix/frontend";
|
||||||
|
description = "
|
||||||
|
Directory where the dynamically generated configuration data
|
||||||
|
of the PHP frontend will be stored.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user