commit
5c80009d0d
@ -8,6 +8,7 @@ let
|
|||||||
wrappedPlugins = pkgs.runCommand "wrapped-plugins" { preferLocalBuild = true; } ''
|
wrappedPlugins = pkgs.runCommand "wrapped-plugins" { preferLocalBuild = true; } ''
|
||||||
mkdir -p $out/libexec/netdata/plugins.d
|
mkdir -p $out/libexec/netdata/plugins.d
|
||||||
ln -s /run/wrappers/bin/apps.plugin $out/libexec/netdata/plugins.d/apps.plugin
|
ln -s /run/wrappers/bin/apps.plugin $out/libexec/netdata/plugins.d/apps.plugin
|
||||||
|
ln -s /run/wrappers/bin/freeipmi.plugin $out/libexec/netdata/plugins.d/freeipmi.plugin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
@ -156,6 +157,13 @@ in {
|
|||||||
permissions = "u+rx,g+rx,o-rwx";
|
permissions = "u+rx,g+rx,o-rwx";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
security.wrappers."freeipmi.plugin" = {
|
||||||
|
source = "${pkgs.netdata}/libexec/netdata/plugins.d/freeipmi.plugin.org";
|
||||||
|
capabilities = "cap_dac_override,cap_fowner+ep";
|
||||||
|
owner = cfg.user;
|
||||||
|
group = cfg.group;
|
||||||
|
permissions = "u+rx,g+rx,o-rwx";
|
||||||
|
};
|
||||||
|
|
||||||
users.users = optional (cfg.user == defaultUser) {
|
users.users = optional (cfg.user == defaultUser) {
|
||||||
name = defaultUser;
|
name = defaultUser;
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
{ 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
|
||||||
|
, withDebug ? false
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec{
|
with stdenv.lib;
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
version = "1.15.0";
|
version = "1.15.0";
|
||||||
name = "netdata-${version}";
|
name = "netdata-${version}";
|
||||||
|
|
||||||
@ -10,20 +21,32 @@ stdenv.mkDerivation rec{
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
||||||
buildInputs = [ zlib ]
|
buildInputs = [ curl.dev zlib.dev ]
|
||||||
++ (if stdenv.isDarwin then [ libossp_uuid CoreFoundation IOKit ] else [ libuuid ]);
|
++ 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 = [
|
patches = [
|
||||||
./no-files-in-etc-and-var.patch
|
./no-files-in-etc-and-var.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
postInstall = stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
NIX_CFLAGS_COMPILE = optional withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1";
|
||||||
|
|
||||||
|
postInstall = optionalString (!stdenv.isDarwin) ''
|
||||||
# rename this plugin so netdata will look for setuid wrapper
|
# rename this plugin so netdata will look for setuid wrapper
|
||||||
mv $out/libexec/netdata/plugins.d/apps.plugin \
|
mv $out/libexec/netdata/plugins.d/apps.plugin \
|
||||||
$out/libexec/netdata/plugins.d/apps.plugin.org
|
$out/libexec/netdata/plugins.d/apps.plugin.org
|
||||||
|
${optionalString withIpmi ''
|
||||||
|
mv $out/libexec/netdata/plugins.d/freeipmi.plugin \
|
||||||
|
$out/libexec/netdata/plugins.d/freeipmi.plugin.org
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = optionalString (!stdenv.isDarwin) ''
|
||||||
substituteInPlace collectors/python.d.plugin/python_modules/third_party/lm_sensors.py \
|
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}"'
|
--replace 'ctypes.util.find_library("sensors")' '"${lm_sensors.out}/lib/libsensors${stdenv.hostPlatform.extensions.sharedLibrary}"'
|
||||||
'';
|
'';
|
||||||
@ -37,7 +60,7 @@ stdenv.mkDerivation rec{
|
|||||||
rm -r $out/sbin
|
rm -r $out/sbin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = {
|
||||||
description = "Real-time performance monitoring tool";
|
description = "Real-time performance monitoring tool";
|
||||||
homepage = https://my-netdata.io/;
|
homepage = https://my-netdata.io/;
|
||||||
license = licenses.gpl3;
|
license = licenses.gpl3;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user