nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 libiconv,
7 openssl,
8 pcre,
9 pcre2,
10}:
11
12import ./versions.nix (
13 { version, hash, ... }:
14 stdenv.mkDerivation {
15 pname = "zabbix-agent";
16 inherit version;
17
18 src = fetchurl {
19 url = "https://cdn.zabbix.com/zabbix/sources/stable/${lib.versions.majorMinor version}/zabbix-${version}.tar.gz";
20 inherit hash;
21 };
22
23 nativeBuildInputs = [ pkg-config ];
24 buildInputs = [
25 libiconv
26 openssl
27 (if (lib.versions.major version >= "7" && lib.versions.minor version >= "4") then pcre2 else pcre)
28 ];
29
30 configureFlags = [
31 "--enable-agent"
32 "--enable-ipv6"
33 "--with-iconv"
34 "--with-libpcre"
35 "--with-openssl=${openssl.dev}"
36 ];
37 makeFlags = [
38 "AR:=$(AR)"
39 "RANLIB:=$(RANLIB)"
40 ];
41
42 postInstall = ''
43 cp conf/zabbix_agentd/*.conf $out/etc/zabbix_agentd.conf.d/
44 '';
45
46 meta = {
47 description = "Enterprise-class open source distributed monitoring solution (client-side agent)";
48 homepage = "https://www.zabbix.com/";
49 license =
50 if (lib.versions.major version >= "7") then lib.licenses.agpl3Only else lib.licenses.gpl2Plus;
51 maintainers = with lib.maintainers; [
52 bstanderline
53 mmahut
54 psyanticy
55 ];
56 platforms = lib.platforms.unix;
57 };
58 }
59)