Merge pull request #107064 from aanderse/nixos/zabbixWeb

nixos/zabbixWeb: include DOUBLE_IEEE754 directive
This commit is contained in:
Aaron Andersen 2020-12-28 00:22:35 -05:00 committed by GitHub
commit a08ed097c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,7 @@
let
inherit (lib) mkDefault mkEnableOption mkForce mkIf mkMerge mkOption types;
inherit (lib) literalExample mapAttrs optionalString;
inherit (lib) literalExample mapAttrs optionalString versionAtLeast;
cfg = config.services.zabbixWeb;
fpm = config.services.phpfpm.pools.zabbix;
@ -28,6 +28,8 @@ let
$ZBX_SERVER_PORT = '${toString cfg.server.port}';
$ZBX_SERVER_NAME = ''';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
${cfg.extraConfig}
'';
in
@ -143,6 +145,14 @@ in
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Additional configuration to be copied verbatim into <filename>zabbix.conf.php</filename>.
'';
};
};
};
@ -150,6 +160,10 @@ in
config = mkIf cfg.enable {
services.zabbixWeb.extraConfig = optionalString ((versionAtLeast config.system.stateVersion "20.09") && (versionAtLeast cfg.package.version "5.0.0")) ''
$DB['DOUBLE_IEEE754'] = 'true';
'';
systemd.tmpfiles.rules = [
"d '${stateDir}' 0750 ${user} ${group} - -"
"d '${stateDir}/session' 0750 ${user} ${config.services.httpd.group} - -"