summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/zabbix-agent.nix
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2018-08-28 17:10:45 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2018-08-28 17:43:12 +0300
commit69b4f427b67fe83ddb2bb3ee113770aa802e5643 (patch)
tree2237f00cb38ab4e3e102074d917c4b7f5bce5736 /nixos/modules/services/monitoring/zabbix-agent.nix
parent5bb9ebce4c193bebdcabab30ab56e1049cec1c05 (diff)
downloadnixpkgs-69b4f427b67fe83ddb2bb3ee113770aa802e5643.tar
nixpkgs-69b4f427b67fe83ddb2bb3ee113770aa802e5643.tar.gz
nixpkgs-69b4f427b67fe83ddb2bb3ee113770aa802e5643.tar.bz2
nixpkgs-69b4f427b67fe83ddb2bb3ee113770aa802e5643.tar.lz
nixpkgs-69b4f427b67fe83ddb2bb3ee113770aa802e5643.tar.xz
nixpkgs-69b4f427b67fe83ddb2bb3ee113770aa802e5643.tar.zst
nixpkgs-69b4f427b67fe83ddb2bb3ee113770aa802e5643.zip
nixos/zabbix-agent: Make the Zabbix package user-configurable
Diffstat (limited to 'nixos/modules/services/monitoring/zabbix-agent.nix')
-rw-r--r--nixos/modules/services/monitoring/zabbix-agent.nix16
1 files changed, 14 insertions, 2 deletions
diff --git a/nixos/modules/services/monitoring/zabbix-agent.nix b/nixos/modules/services/monitoring/zabbix-agent.nix
index 87857225e7d..426cf9bf86e 100644
--- a/nixos/modules/services/monitoring/zabbix-agent.nix
+++ b/nixos/modules/services/monitoring/zabbix-agent.nix
@@ -7,6 +7,8 @@ let
 
   cfg = config.services.zabbixAgent;
 
+  zabbix = cfg.package;
+
   stateDir = "/var/run/zabbix";
 
   logDir = "/var/log/zabbix";
@@ -44,6 +46,16 @@ in
         '';
       };
 
+      package = mkOption {
+        type = types.attrs; # Note: pkgs.zabbixXY isn't a derivation, but an attrset of { server = ...; agent = ...; }.
+        default = pkgs.zabbix;
+        defaultText = "pkgs.zabbix";
+        example = literalExample "pkgs.zabbix34";
+        description = ''
+          The Zabbix package to use.
+        '';
+      };
+
       server = mkOption {
         default = "127.0.0.1";
         description = ''
@@ -87,14 +99,14 @@ in
             chown zabbix ${stateDir} ${logDir}
           '';
 
-        serviceConfig.ExecStart = "@${pkgs.zabbix.agent}/sbin/zabbix_agentd zabbix_agentd --config ${configFile}";
+        serviceConfig.ExecStart = "@${zabbix.agent}/sbin/zabbix_agentd zabbix_agentd --config ${configFile}";
         serviceConfig.Type = "forking";
         serviceConfig.RemainAfterExit = true;
         serviceConfig.Restart = "always";
         serviceConfig.RestartSec = 2;
       };
 
-    environment.systemPackages = [ pkgs.zabbix.agent ];
+    environment.systemPackages = [ zabbix.agent ];
 
   };