diff --git a/modules/services/web-servers/apache-httpd/zabbix.nix b/modules/services/web-servers/apache-httpd/zabbix.nix index 6191d63584a..b485279b371 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 = "