From 89904709510971003c58bf41a8fd28780fc45da6 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 13 Jun 2013 02:28:23 +0200 Subject: [PATCH] apache-httpd/zabbix: Allow custom configFile. If option is left by its default value, behaviour is the same as before, using the configuration file created by the web interface. Signed-off-by: aszlig --- .../web-servers/apache-httpd/zabbix.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/services/web-servers/apache-httpd/zabbix.nix b/modules/services/web-servers/apache-httpd/zabbix.nix index 6191d63584a9..b485279b3710 100644 --- a/modules/services/web-servers/apache-httpd/zabbix.nix +++ b/modules/services/web-servers/apache-httpd/zabbix.nix @@ -11,10 +11,11 @@ let # we could generate zabbix.conf.php declaratively. zabbixPHP = pkgs.runCommand "${pkgs.zabbix.server.name}-php" {} '' - cp -rs ${pkgs.zabbix.server}/share/zabbix/php $out + cp -rs ${pkgs.zabbix.server}/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 + ln -s "${if config.configFile == null + then "${config.stateDir}/zabbix.conf.php" + else config.configFile}" "$out/conf/zabbix.conf.php" ''; in @@ -57,6 +58,16 @@ in "; }; + configFile = pkgs.lib.mkOption { + default = null; + type = with pkgs.lib.types; nullOr path; + description = '' + The configuration file (zabbix.conf.php) which contains the database + connection settings. If not set, the configuration settings will created + by the web installer. + ''; + }; + stateDir = pkgs.lib.mkOption { default = "/var/lib/zabbix/frontend"; description = "