diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index f0082f4a441..6302c743f66 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -1,6 +1,16 @@ -{ stdenv, fetchurl, autoreconfHook, pkgconfig, zlib, libuuid, libossp_uuid, CoreFoundation, IOKit, lm_sensors }: +{ stdenv, fetchurl, autoreconfHook, pkgconfig +, CoreFoundation, IOKit, libossp_uuid +, curl, libcap, libuuid, lm_sensors, zlib +, withCups ? false, cups +, withDBengine ? true, libuv, lz4, judy +, withIpmi ? (!stdenv.isDarwin), freeipmi +, withNetfilter ? (!stdenv.isDarwin), libmnl, libnetfilter_acct +, withSsl ? true, openssl +}: -stdenv.mkDerivation rec{ +with stdenv.lib; + +stdenv.mkDerivation rec { version = "1.15.0"; name = "netdata-${version}"; @@ -10,20 +20,26 @@ stdenv.mkDerivation rec{ }; nativeBuildInputs = [ autoreconfHook pkgconfig ]; - buildInputs = [ zlib ] - ++ (if stdenv.isDarwin then [ libossp_uuid CoreFoundation IOKit ] else [ libuuid ]); + buildInputs = [ curl.dev zlib.dev ] + ++ optionals stdenv.isDarwin [ CoreFoundation IOKit libossp_uuid ] + ++ optionals (!stdenv.isDarwin) [ libcap.dev libuuid.dev ] + ++ optionals withCups [ cups ] + ++ optionals withDBengine [ libuv lz4.dev judy ] + ++ optionals withIpmi [ freeipmi ] + ++ optionals withNetfilter [ libmnl libnetfilter_acct ] + ++ optionals withSsl [ openssl.dev ]; patches = [ ./no-files-in-etc-and-var.patch ]; - postInstall = stdenv.lib.optionalString (!stdenv.isDarwin) '' + postInstall = optionalString (!stdenv.isDarwin) '' # rename this plugin so netdata will look for setuid wrapper mv $out/libexec/netdata/plugins.d/apps.plugin \ $out/libexec/netdata/plugins.d/apps.plugin.org ''; - preConfigure = '' + preConfigure = optionalString (!stdenv.isDarwin) '' substituteInPlace collectors/python.d.plugin/python_modules/third_party/lm_sensors.py \ --replace 'ctypes.util.find_library("sensors")' '"${lm_sensors.out}/lib/libsensors${stdenv.hostPlatform.extensions.sharedLibrary}"' ''; @@ -37,7 +53,7 @@ stdenv.mkDerivation rec{ rm -r $out/sbin ''; - meta = with stdenv.lib; { + meta = { description = "Real-time performance monitoring tool"; homepage = https://my-netdata.io/; license = licenses.gpl3;