1{ stdenv, fetchFromGitHub, autoreconfHook, zlib, pkgconfig, libuuid }:
2
3stdenv.mkDerivation rec{
4 version = "1.9.0";
5 name = "netdata-${version}";
6
7 src = fetchFromGitHub {
8 rev = "v${version}";
9 owner = "firehol";
10 repo = "netdata";
11 sha256 = "1vy0jz5lxw63b830l9jgf1qqhp41gzapyhdr5k1gwg3zghvlg10w";
12 };
13
14 nativeBuildInputs = [ autoreconfHook pkgconfig ];
15 buildInputs = [ zlib libuuid ];
16
17 # Allow UI to load when running as non-root
18 patches = [ ./web_access.patch ];
19
20 # Build will fail trying to create /var/{cache,lib,log}/netdata without this
21 postPatch = ''
22 sed -i '/dist_.*_DATA = \.keep/d' src/Makefile.am
23 '';
24
25 configureFlags = [
26 "--localstatedir=/var"
27 ];
28
29 # App fails on runtime if the default config file is not detected
30 # The upstream installer does prepare an empty file too
31 postInstall = ''
32 touch $out/etc/netdata/netdata.conf
33 '';
34
35 meta = with stdenv.lib; {
36 description = "Real-time performance monitoring tool";
37 homepage = http://netdata.firehol.org;
38 license = licenses.gpl3;
39 platforms = platforms.linux;
40 maintainers = [ maintainers.lethalman ];
41 };
42
43}