2020-02-21 23:45:50 -08:00
|
|
|
{ stdenv, callPackage, fetchFromGitHub, autoreconfHook, pkgconfig
|
2019-07-03 03:49:29 -07:00
|
|
|
, CoreFoundation, IOKit, libossp_uuid
|
2020-02-22 12:21:10 -08:00
|
|
|
, curl, libcap, libuuid, lm_sensors, zlib, fetchpatch
|
2019-07-03 03:49:29 -07:00
|
|
|
, withCups ? false, cups
|
|
|
|
, withDBengine ? true, libuv, lz4, judy
|
|
|
|
, withIpmi ? (!stdenv.isDarwin), freeipmi
|
|
|
|
, withNetfilter ? (!stdenv.isDarwin), libmnl, libnetfilter_acct
|
|
|
|
, withSsl ? true, openssl
|
2019-07-04 03:08:11 -07:00
|
|
|
, withDebug ? false
|
2019-07-03 03:49:29 -07:00
|
|
|
}:
|
2016-04-14 14:43:01 -07:00
|
|
|
|
2019-07-03 03:49:29 -07:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2020-02-21 23:45:50 -08:00
|
|
|
let
|
|
|
|
go-d-plugin = callPackage ./go.d.plugin.nix {};
|
|
|
|
in stdenv.mkDerivation rec {
|
2020-06-26 08:49:45 -07:00
|
|
|
version = "1.23.0";
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "netdata";
|
2016-04-14 14:43:01 -07:00
|
|
|
|
2019-12-07 13:04:30 -08:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "netdata";
|
|
|
|
repo = "netdata";
|
|
|
|
rev = "v${version}";
|
2020-06-26 08:49:45 -07:00
|
|
|
sha256 = "04x53hr2d086y4q990h7lazaykaizb5g45nmfvahqzxj72b0hvdf";
|
2016-04-14 14:43:01 -07:00
|
|
|
};
|
|
|
|
|
2017-09-05 14:26:13 -07:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
2019-07-03 03:49:29 -07:00
|
|
|
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 ];
|
2016-04-14 14:43:01 -07:00
|
|
|
|
2018-10-12 01:53:36 -07:00
|
|
|
patches = [
|
|
|
|
./no-files-in-etc-and-var.patch
|
|
|
|
];
|
2016-10-25 07:23:19 -07:00
|
|
|
|
2019-10-30 04:34:47 -07:00
|
|
|
NIX_CFLAGS_COMPILE = optionalString withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1";
|
2019-07-04 03:08:11 -07:00
|
|
|
|
2020-02-21 23:45:50 -08:00
|
|
|
postInstall = ''
|
2020-04-14 02:20:00 -07:00
|
|
|
ln -s ${go-d-plugin}/lib/netdata/conf.d/* $out/lib/netdata/conf.d
|
|
|
|
ln -s ${go-d-plugin}/bin/godplugin $out/libexec/netdata/plugins.d/go.d.plugin
|
2020-02-21 23:45:50 -08:00
|
|
|
'' + optionalString (!stdenv.isDarwin) ''
|
2018-10-12 01:57:45 -07:00
|
|
|
# rename this plugin so netdata will look for setuid wrapper
|
|
|
|
mv $out/libexec/netdata/plugins.d/apps.plugin \
|
2019-06-26 10:38:01 -07:00
|
|
|
$out/libexec/netdata/plugins.d/apps.plugin.org
|
2020-03-23 02:23:50 -07:00
|
|
|
mv $out/libexec/netdata/plugins.d/perf.plugin \
|
|
|
|
$out/libexec/netdata/plugins.d/perf.plugin.org
|
2020-03-23 00:27:29 -07:00
|
|
|
mv $out/libexec/netdata/plugins.d/slabinfo.plugin \
|
|
|
|
$out/libexec/netdata/plugins.d/slabinfo.plugin.org
|
2019-07-04 02:09:54 -07:00
|
|
|
${optionalString withIpmi ''
|
|
|
|
mv $out/libexec/netdata/plugins.d/freeipmi.plugin \
|
|
|
|
$out/libexec/netdata/plugins.d/freeipmi.plugin.org
|
|
|
|
''}
|
2018-10-12 01:57:45 -07:00
|
|
|
'';
|
|
|
|
|
2020-03-23 00:27:29 -07:00
|
|
|
preConfigure = optionalString (!stdenv.isDarwin) ''
|
2019-03-07 13:01:48 -08:00
|
|
|
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}"'
|
|
|
|
'';
|
|
|
|
|
2016-10-25 07:23:19 -07:00
|
|
|
configureFlags = [
|
|
|
|
"--localstatedir=/var"
|
2018-10-12 01:53:36 -07:00
|
|
|
"--sysconfdir=/etc"
|
2016-10-25 07:23:19 -07:00
|
|
|
];
|
|
|
|
|
2018-11-14 08:01:41 -08:00
|
|
|
postFixup = ''
|
|
|
|
rm -r $out/sbin
|
2016-10-14 03:05:42 -07:00
|
|
|
'';
|
2016-04-17 02:15:59 -07:00
|
|
|
|
2019-07-03 03:49:29 -07:00
|
|
|
meta = {
|
2016-04-14 14:43:01 -07:00
|
|
|
description = "Real-time performance monitoring tool";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://my-netdata.io/";
|
2016-04-14 14:43:01 -07:00
|
|
|
license = licenses.gpl3;
|
2018-11-14 08:01:41 -08:00
|
|
|
platforms = platforms.unix;
|
2016-04-14 14:43:01 -07:00
|
|
|
maintainers = [ maintainers.lethalman ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|