about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2020-12-28 00:22:35 -0500
committerGitHub <noreply@github.com>2020-12-28 00:22:35 -0500
commita08ed097c9e609567407476f143d2efba41328b6 (patch)
treef978ac8b0d2f3b218ec23653241a1c8fcdea5056
parentc7ab9b55b8b666e879cd9911e220da6d0dfd3ac2 (diff)
parent0a20166ca199e5297a9f72fdd99f71d0c9e0a362 (diff)
downloadnixlib-a08ed097c9e609567407476f143d2efba41328b6.tar
nixlib-a08ed097c9e609567407476f143d2efba41328b6.tar.gz
nixlib-a08ed097c9e609567407476f143d2efba41328b6.tar.bz2
nixlib-a08ed097c9e609567407476f143d2efba41328b6.tar.lz
nixlib-a08ed097c9e609567407476f143d2efba41328b6.tar.xz
nixlib-a08ed097c9e609567407476f143d2efba41328b6.tar.zst
nixlib-a08ed097c9e609567407476f143d2efba41328b6.zip
Merge pull request #107064 from aanderse/nixos/zabbixWeb
nixos/zabbixWeb: include DOUBLE_IEEE754 directive
-rw-r--r--nixos/modules/services/web-apps/zabbix.nix16
1 files changed, 15 insertions, 1 deletions
diff --git a/nixos/modules/services/web-apps/zabbix.nix b/nixos/modules/services/web-apps/zabbix.nix
index 007195128347..e94861a90b5a 100644
--- a/nixos/modules/services/web-apps/zabbix.nix
+++ b/nixos/modules/services/web-apps/zabbix.nix
@@ -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} - -"