From 8ce23cfec212ed868f81a44871ed9cbd3225523a Mon Sep 17 00:00:00 2001 From: Kranium Gikos Mendoza Date: Tue, 25 Oct 2016 22:23:19 +0800 Subject: [PATCH] netdata: allow execution without a config file --- pkgs/tools/system/netdata/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index 30d9d6b4ef37..46932076177f 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -16,11 +16,19 @@ stdenv.mkDerivation rec{ # Allow UI to load when running as non-root patches = [ ./web_access.patch ]; - preConfigure = '' - export ZLIB_CFLAGS=" " - export ZLIB_LIBS="-lz" - export UUID_CFLAGS=" " - export UUID_LIBS="-luuid" + # Build will fail trying to create /var/{cache,lib,log}/netdata without this + postPatch = '' + sed -i '/dist_.*_DATA = \.keep/d' src/Makefile.am + ''; + + configureFlags = [ + "--localstatedir=/var" + ]; + + # App fails on runtime if the default config file is not detected + # The upstream installer does prepare an empty file too + postInstall = '' + touch $out/etc/netdata/netdata.conf ''; meta = with stdenv.lib; {