From e688a60e6991df7cc247c67bda3cd14350b035cd Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 24 Mar 2024 15:10:09 +0100 Subject: [PATCH 01/16] netdata: 1.44.3 -> 1.45.0 https://github.com/netdata/netdata/releases/tag/v1.45.0 Netdata moved to CMake and required an overhaul of the whole expression. `netdata-go-plugins` has been moved back in the monorepo, leading to a removal of the standalone Go plugin expression. The eBPF plugin is broken for now. The patch for disabling the dashboard v2 has been upgraded and sent to upstream again. ACLK is correctly rendered optional now. This adds the network-viewer, logs-management and debugfs plugin support. Signed-off-by: Raito Bezarius --- pkgs/tools/system/netdata/default.nix | 138 ++++++++++++------ pkgs/tools/system/netdata/go.d.plugin.nix | 35 ----- .../netdata/no-files-in-etc-and-var.patch | 128 ---------------- .../netdata/skip-CONFIGURE_COMMAND.patch | 16 -- pkgs/top-level/all-packages.nix | 2 - 5 files changed, 95 insertions(+), 224 deletions(-) delete mode 100644 pkgs/tools/system/netdata/go.d.plugin.nix delete mode 100644 pkgs/tools/system/netdata/no-files-in-etc-and-var.patch delete mode 100644 pkgs/tools/system/netdata/skip-CONFIGURE_COMMAND.patch diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index b2461760da70..775a425edb91 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -1,9 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config, makeWrapper +{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config, makeWrapper , CoreFoundation, IOKit, libossp_uuid , nixosTests -, netdata-go-plugins -, bash, curl, jemalloc, json_c, libuv, zlib, libyaml +, bash, curl, jemalloc, json_c, libuv, zlib, libyaml, libelf, libbpf , libcap, libuuid, lm_sensors, protobuf +, go, buildGoModule, ninja , withCups ? false, cups , withDBengine ? true, lz4 , withIpmi ? (!stdenv.isDarwin), freeipmi @@ -15,11 +15,13 @@ , withSsl ? true, openssl , withSystemdJournal ? (!stdenv.isDarwin), systemd , withDebug ? false +, withEbpf ? false +, withNetworkViewer ? (!stdenv.isDarwin) }: stdenv.mkDerivation rec { # Don't forget to update go.d.plugin.nix as well - version = "1.44.3"; + version = "1.45.0"; pname = "netdata"; src = fetchFromGitHub { @@ -27,21 +29,21 @@ stdenv.mkDerivation rec { repo = "netdata"; rev = "v${version}"; hash = if withCloudUi - then "sha256-ahWaq6geEoc6NZ2oU/Dqnb0bjRXd+q1zaRGOSIYVYok=" - else "sha256-2Kvh2WuoJjJxsFKueMjCAbazqZdzoOTxakbPVsj9PBo="; + then "sha256-AyhS5vwGZLnc+xmf9Qvk2v8rTzhHSUe7LpAbwRYjrKM=" + else "sha256-11UHXPnXC4pzK/oXOZJ7f9X86EV9uHOvMtOCnxTV86U="; fetchSubmodules = true; # Remove v2 dashboard distributed under NCUL1. Make sure an empty # Makefile.am exists, as autoreconf will get confused otherwise. postFetch = lib.optionalString (!withCloudUi) '' - rm -rf $out/web/gui/v2/* - touch $out/web/gui/v2/Makefile.am + rm -rf $out/src/web/gui/v2/* + touch $out/src/web/gui/v2/Makefile.am ''; }; strictDeps = true; - nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper protobuf ]; + nativeBuildInputs = [ cmake pkg-config makeWrapper go ninja ]; # bash is only used to rewrite shebangs buildInputs = [ bash curl jemalloc json_c libuv zlib libyaml ] ++ lib.optionals stdenv.isDarwin [ CoreFoundation IOKit libossp_uuid ] @@ -52,23 +54,16 @@ stdenv.mkDerivation rec { ++ lib.optionals withNetfilter [ libmnl libnetfilter_acct ] ++ lib.optionals withConnPubSub [ google-cloud-cpp grpc ] ++ lib.optionals withConnPrometheus [ snappy ] + ++ lib.optionals withEbpf [ libelf libbpf ] ++ lib.optionals (withCloud || withConnPrometheus) [ protobuf ] ++ lib.optionals withSystemdJournal [ systemd ] ++ lib.optionals withSsl [ openssl ]; patches = [ - # required to prevent plugins from relying on /etc - # and /var - ./no-files-in-etc-and-var.patch - - # Avoid build-only inputs in closure leaked by configure command: - # https://github.com/NixOS/nixpkgs/issues/175693#issuecomment-1143344162 - ./skip-CONFIGURE_COMMAND.patch - # Allow building without non-free v2 dashboard. (fetchpatch { - url = "https://github.com/peat-psuwit/netdata/commit/6ccbdd1500db2b205923968688d5f1777430a326.patch"; - hash = "sha256-jAyk5HlxdjFn5IP6jOKP8/SXOraMQSA6r1krThe+s7g="; + url = "https://github.com/netdata/netdata/pull/17240/commits/b108df72281633234b731b223d99ec99f1d36adf.patch"; + hash = "sha256-tgsnbNY0pxFU3bz1J1qPaAeVsozsk2bpHV2mNy8A9is="; }) ]; @@ -83,8 +78,8 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = lib.optionalString withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1"; postInstall = '' - ln -s ${netdata-go-plugins}/lib/netdata/conf.d/* $out/lib/netdata/conf.d - ln -s ${netdata-go-plugins}/bin/godplugin $out/libexec/netdata/plugins.d/go.d.plugin + # Relocate one folder above. + mv $out/usr/* $out/ '' + lib.optionalString (!stdenv.isDarwin) '' # rename this plugin so netdata will look for setuid wrapper mv $out/libexec/netdata/plugins.d/apps.plugin \ @@ -95,6 +90,10 @@ stdenv.mkDerivation rec { $out/libexec/netdata/plugins.d/perf.plugin.org mv $out/libexec/netdata/plugins.d/slabinfo.plugin \ $out/libexec/netdata/plugins.d/slabinfo.plugin.org + mv $out/libexec/netdata/plugins.d/debugfs.plugin \ + $out/libexec/netdata/plugins.d/debugfs.plugin.org + mv $out/libexec/netdata/plugins.d/logs-management.plugin \ + $out/libexec/netdata/plugins.d/logs-management.plugin.org ${lib.optionalString withSystemdJournal '' mv $out/libexec/netdata/plugins.d/systemd-journal.plugin \ $out/libexec/netdata/plugins.d/systemd-journal.plugin.org @@ -103,47 +102,100 @@ stdenv.mkDerivation rec { mv $out/libexec/netdata/plugins.d/freeipmi.plugin \ $out/libexec/netdata/plugins.d/freeipmi.plugin.org ''} + ${lib.optionalString withNetworkViewer '' + mv $out/libexec/netdata/plugins.d/network-viewer.plugin \ + $out/libexec/netdata/plugins.d/network-viewer.plugin.org + ''} ''; preConfigure = lib.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}"' + substituteInPlace src/collectors/python.d.plugin/python_modules/third_party/lm_sensors.py \ + --replace-fail 'ctypes.util.find_library("sensors")' '"${lm_sensors.out}/lib/libsensors${stdenv.hostPlatform.extensions.sharedLibrary}"' + '' + '' + export GOCACHE=$TMPDIR/go-cache + export GOPATH=$TMPDIR/go + export GOPROXY=file://${passthru.netdata-go-modules} + export GOSUMDB=off + + # Prevent the path to be caught into the Nix store path. + substituteInPlace CMakeLists.txt \ + --replace-fail 'set(CACHE_DIR "''${CMAKE_INSTALL_PREFIX}/var/cache/netdata")' 'set(CACHE_DIR "/var/cache/netdata")' \ + --replace-fail 'set(CONFIG_DIR "''${CMAKE_INSTALL_PREFIX}/etc/netdata")' 'set(CONFIG_DIR "/etc/netdata")' \ + --replace-fail 'set(LIBCONFIG_DIR "''${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/conf.d")' 'set(LIBCONFIG_DIR "${placeholder "out"}/share/netdata/conf.d")' \ + --replace-fail 'set(LOG_DIR "''${CMAKE_INSTALL_PREFIX}/var/log/netdata")' 'set(LOG_DIR "/var/log/netdata")' \ + --replace-fail 'set(PLUGINS_DIR "''${CMAKE_INSTALL_PREFIX}/usr/libexec/netdata/plugins.d")' 'set(PLUGINS_DIR "${placeholder "out"}/libexec/netdata/plugins.d")' \ + --replace-fail 'set(VARLIB_DIR "''${CMAKE_INSTALL_PREFIX}/var/lib/netdata")' 'set(VARLIB_DIR "/var/lib/netdata")' \ + --replace-fail 'set(pkglibexecdir_POST "''${CMAKE_INSTALL_PREFIX}/usr/libexec/netdata")' 'set(pkglibexecdir_POST "${placeholder "out"}/libexec/netdata")' \ + --replace-fail 'set(localstatedir_POST "''${CMAKE_INSTALL_PREFIX}/var")' 'set(localstatedir_POST "/var")' \ + --replace-fail 'set(sbindir_POST "''${CMAKE_INSTALL_PREFIX}/usr/sbin")' 'set(sbindir_POST "${placeholder "out"}/bin")' \ + --replace-fail 'set(configdir_POST "''${CMAKE_INSTALL_PREFIX}/etc/netdata")' 'set(configdir_POST "/etc/netdata")' \ + --replace-fail 'set(libconfigdir_POST "''${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/conf.d")' 'set(libconfigdir_POST "${placeholder "out"}/share/netdata/conf.d")' \ + --replace-fail 'set(cachedir_POST "''${CMAKE_INSTALL_PREFIX}/var/cache/netdata")' 'set(libconfigdir_POST "/var/cache/netdata")' \ + --replace-fail 'set(registrydir_POST "''${CMAKE_INSTALL_PREFIX}/var/lib/netdata/registry")' 'set(registrydir_POST "/var/lib/netdata/registry")' \ + --replace-fail 'set(varlibdir_POST "''${CMAKE_INSTALL_PREFIX}/var/lib/netdata")' 'set(varlibdir_POST "/var/lib/netdata")' ''; - configureFlags = [ - "--localstatedir=/var" - "--sysconfdir=/etc" - "--disable-ebpf" - "--with-jemalloc=${jemalloc}" - ] ++ lib.optionals (withSystemdJournal) [ - "--enable-plugin-systemd-journal" - ] ++ lib.optionals (!withDBengine) [ - "--disable-dbengine" - ] ++ lib.optionals (!withCloud) [ - "--disable-cloud" - ] ++ lib.optionals (!withCloudUi) [ - "--disable-cloud-ui" + cmakeFlags = [ + "-DWEB_DIR=share/netdata/web" + (lib.cmakeBool "ENABLE_CLOUD" withCloud) + # ACLK is agent cloud link. + (lib.cmakeBool "ENABLE_ACLK" withCloud) + (lib.cmakeBool "ENABLE_DASHBOARD_V2" withCloudUi) + (lib.cmakeBool "ENABLE_DBENGINE" withDBengine) + (lib.cmakeBool "ENABLE_PLUGIN_FREEIPMI" withIpmi) + (lib.cmakeBool "ENABLE_PLUGIN_SYSTEMD_JOURNAL" withSystemdJournal) + (lib.cmakeBool "ENABLE_PLUGIN_NETWORK_VIEWER" withNetworkViewer) + (lib.cmakeBool "ENABLE_PLUGIN_EBPF" withEbpf) + # raitobezarius: I do not wish to maintain Xen-related things alone, thus, disabled. + # Feel free to open an issue / PR to fix this. + (lib.cmakeBool "ENABLE_PLUGIN_XENSTAT" false) + (lib.cmakeBool "ENABLE_PLUGIN_CUPS" withCups) + (lib.cmakeBool "ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE" withConnPrometheus) + (lib.cmakeBool "ENABLE_JEMALLOC" true) + # Suggested by upstream. + "-G Ninja" ]; postFixup = '' - # remove once https://github.com/netdata/netdata/pull/16300 merged - substituteInPlace $out/bin/netdata-claim.sh \ - --replace /bin/echo echo - wrapProgram $out/bin/netdata-claim.sh --prefix PATH : ${lib.makeBinPath [ openssl ]} wrapProgram $out/libexec/netdata/plugins.d/cgroup-network-helper.sh --prefix PATH : ${lib.makeBinPath [ bash ]} wrapProgram $out/bin/netdatacli --set NETDATA_PIPENAME /run/netdata/ipc + + # Time to cleanup the output directory. + unlink $out/sbin + cp $out/etc/netdata/edit-config $out/bin/netdata-edit-config + mv $out/lib/netdata/conf.d $out/share/netdata/conf.d + rm -rf $out/{var,usr,etc} ''; enableParallelBuild = true; - passthru = { - inherit withIpmi; + passthru = rec { + netdata-go-modules = (buildGoModule { + pname = "netdata-go-plugins"; + inherit version src; + + sourceRoot = "${src.name}/src/go/collectors/go.d.plugin"; + + vendorHash = "sha256-KO+xMk6fpZCYRyxxKrsGfOHJ2bwjBaSmkgz1jIUHaZs="; + doCheck = false; + proxyVendor = true; + + ldflags = [ "-s" "-w" "-X main.version=${version}" ]; + + passthru.tests = tests; + meta = meta // { + description = "Netdata orchestrator for data collection modules written in Go"; + mainProgram = "godplugin"; + license = lib.licenses.gpl3Only; + }; + }).goModules; + inherit withIpmi withNetworkViewer; tests.netdata = nixosTests.netdata; }; meta = with lib; { - broken = stdenv.isDarwin || stdenv.buildPlatform != stdenv.hostPlatform; + broken = stdenv.isDarwin || stdenv.buildPlatform != stdenv.hostPlatform || withEbpf; description = "Real-time performance monitoring tool"; homepage = "https://www.netdata.cloud/"; changelog = "https://github.com/netdata/netdata/releases/tag/v${version}"; diff --git a/pkgs/tools/system/netdata/go.d.plugin.nix b/pkgs/tools/system/netdata/go.d.plugin.nix deleted file mode 100644 index 910ad29c13fa..000000000000 --- a/pkgs/tools/system/netdata/go.d.plugin.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ lib, fetchFromGitHub, buildGoModule, nixosTests }: - -buildGoModule rec { - pname = "netdata-go-plugins"; - version = "0.58.1"; - - src = fetchFromGitHub { - owner = "netdata"; - repo = "go.d.plugin"; - rev = "v${version}"; - hash = "sha256-zzHm98jec7MXnzVsrLlYIk+ILA3Ei43853dM1LdFz5c="; - }; - - vendorHash = "sha256-eb+GRFhfWxDkfH4x2VF3ogyT5z4OcIoqHtEVJ1tGsdA="; - - doCheck = false; - - ldflags = [ "-s" "-w" "-X main.version=${version}" ]; - - postInstall = '' - mkdir -p $out/lib/netdata/conf.d - cp -r config/* $out/lib/netdata/conf.d - ''; - - passthru.tests = { inherit (nixosTests) netdata; }; - - meta = with lib; { - description = "Netdata orchestrator for data collection modules written in go"; - mainProgram = "godplugin"; - homepage = "https://github.com/netdata/go.d.plugin"; - changelog = "https://github.com/netdata/go.d.plugin/releases/tag/v${version}"; - license = licenses.gpl3Only; - maintainers = [ maintainers.raitobezarius ]; - }; -} diff --git a/pkgs/tools/system/netdata/no-files-in-etc-and-var.patch b/pkgs/tools/system/netdata/no-files-in-etc-and-var.patch deleted file mode 100644 index 039376fe4e3a..000000000000 --- a/pkgs/tools/system/netdata/no-files-in-etc-and-var.patch +++ /dev/null @@ -1,128 +0,0 @@ -diff --git c/collectors/Makefile.am i/collectors/Makefile.am -index 1bbb2e0ef..96c400d33 100644 ---- c/collectors/Makefile.am -+++ i/collectors/Makefile.am -@@ -33,7 +33,7 @@ usercustompluginsconfigdir=$(configdir)/custom-plugins.d - usergoconfigdir=$(configdir)/go.d - - # Explicitly install directories to avoid permission issues due to umask --install-exec-local: -+no-install-exec-local: - $(INSTALL) -d $(DESTDIR)$(usercustompluginsconfigdir) - $(INSTALL) -d $(DESTDIR)$(usergoconfigdir) - -diff --git c/collectors/charts.d.plugin/Makefile.am i/collectors/charts.d.plugin/Makefile.am -index f82992fd4..4cac1ae4f 100644 ---- c/collectors/charts.d.plugin/Makefile.am -+++ i/collectors/charts.d.plugin/Makefile.am -@@ -34,7 +34,7 @@ dist_userchartsconfig_DATA = \ - $(NULL) - - # Explicitly install directories to avoid permission issues due to umask --install-exec-local: -+no-install-exec-local: - $(INSTALL) -d $(DESTDIR)$(userchartsconfigdir) - - chartsconfigdir=$(libconfigdir)/charts.d -diff --git c/collectors/ebpf.plugin/Makefile.am i/collectors/ebpf.plugin/Makefile.am -index 2d5f92a6b..8b11c7502 100644 ---- c/collectors/ebpf.plugin/Makefile.am -+++ i/collectors/ebpf.plugin/Makefile.am -@@ -9,7 +9,7 @@ SUFFIXES = .in - userebpfconfigdir=$(configdir)/ebpf.d - - # Explicitly install directories to avoid permission issues due to umask --install-exec-local: -+no-install-exec-local: - $(INSTALL) -d $(DESTDIR)$(userebpfconfigdir) - - dist_noinst_DATA = \ -diff --git c/collectors/python.d.plugin/Makefile.am i/collectors/python.d.plugin/Makefile.am -index ca49c1c02..1b9bcc446 100644 ---- c/collectors/python.d.plugin/Makefile.am -+++ i/collectors/python.d.plugin/Makefile.am -@@ -32,7 +32,7 @@ dist_userpythonconfig_DATA = \ - $(NULL) - - # Explicitly install directories to avoid permission issues due to umask --install-exec-local: -+no-install-exec-local: - $(INSTALL) -d $(DESTDIR)$(userpythonconfigdir) - - pythonconfigdir=$(libconfigdir)/python.d -diff --git c/collectors/statsd.plugin/Makefile.am i/collectors/statsd.plugin/Makefile.am -index c8144c137..f8aaa89b6 100644 ---- c/collectors/statsd.plugin/Makefile.am -+++ i/collectors/statsd.plugin/Makefile.am -@@ -19,5 +19,5 @@ dist_userstatsdconfig_DATA = \ - $(NULL) - - # Explicitly install directories to avoid permission issues due to umask --install-exec-local: -+no-install-exec-local: - $(INSTALL) -d $(DESTDIR)$(userstatsdconfigdir) -diff --git c/health/Makefile.am i/health/Makefile.am -index 7d7bca4cc..3086876dd 100644 ---- c/health/Makefile.am -+++ i/health/Makefile.am -@@ -19,7 +19,7 @@ dist_userhealthconfig_DATA = \ - $(NULL) - - # Explicitly install directories to avoid permission issues due to umask --install-exec-local: -+no-install-exec-local: - $(INSTALL) -d $(DESTDIR)$(userhealthconfigdir) - - healthconfigdir=$(libconfigdir)/health.d -diff --git c/logsmanagement/Makefile.am i/logsmanagement/Makefile.am -index 33f08d556..1f08cbae9 100644 ---- c/logsmanagement/Makefile.am -+++ i/logsmanagement/Makefile.am -@@ -6,7 +6,7 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in - userlogsmanagconfigdir=$(configdir)/logsmanagement.d - - # Explicitly install directories to avoid permission issues due to umask --install-exec-local: -+no-install-exec-local: - $(INSTALL) -d $(DESTDIR)$(userlogsmanagconfigdir) - - dist_libconfig_DATA = \ -diff --git c/system/Makefile.am i/system/Makefile.am -index 1e96f6f4f..98122ecdc 100644 ---- c/system/Makefile.am -+++ i/system/Makefile.am -@@ -22,12 +22,9 @@ include $(top_srcdir)/build/subst.inc - SUFFIXES = .in - - dist_config_SCRIPTS = \ -- edit-config \ - $(NULL) - - dist_config_DATA = \ -- .install-type \ -- netdata-updater.conf \ - $(NULL) - - libconfigvnodesdir=$(libconfigdir)/vnodes -@@ -47,7 +44,7 @@ libsysrunitdir=$(libsysdir)/runit - libsyssystemddir=$(libsysdir)/systemd - - # Explicitly install directories to avoid permission issues due to umask --install-exec-local: -+no-install-exec-local: - $(INSTALL) -d $(DESTDIR)$(configdir) - $(INSTALL) -d $(DESTDIR)$(libsysdir) - $(INSTALL) -d $(DESTDIR)$(libsyscrondir) -diff --git c/web/Makefile.am i/web/Makefile.am -index be2c545c3..55f373114 100644 ---- c/web/Makefile.am -+++ i/web/Makefile.am -@@ -13,7 +13,7 @@ SUBDIRS = \ - usersslconfigdir=$(configdir)/ssl - - # Explicitly install directories to avoid permission issues due to umask --install-exec-local: -+no-install-exec-local: - $(INSTALL) -d $(DESTDIR)$(usersslconfigdir) - - dist_noinst_DATA = \ diff --git a/pkgs/tools/system/netdata/skip-CONFIGURE_COMMAND.patch b/pkgs/tools/system/netdata/skip-CONFIGURE_COMMAND.patch deleted file mode 100644 index 472da270798f..000000000000 --- a/pkgs/tools/system/netdata/skip-CONFIGURE_COMMAND.patch +++ /dev/null @@ -1,16 +0,0 @@ -Shrink closure size by avoiding paths embedded from configure call. - -https://github.com/NixOS/nixpkgs/issues/175693 -diff --git a/daemon/buildinfo.c b/daemon/buildinfo.c -index 56cde84fc..011e7579d 100644 ---- a/daemon/buildinfo.c -+++ b/daemon/buildinfo.c -@@ -1040,7 +1040,7 @@ static void build_info_set_status(BUILD_INFO_SLOT slot, bool status) { - - __attribute__((constructor)) void initialize_build_info(void) { - build_info_set_value(BIB_PACKAGING_NETDATA_VERSION, program_version); -- build_info_set_value(BIB_PACKAGING_CONFIGURE_OPTIONS, CONFIGURE_COMMAND); -+ build_info_set_value(BIB_PACKAGING_CONFIGURE_OPTIONS, "REMOVED FOR CLOSURE SIZE REASONS"); - - #ifdef COMPILED_FOR_LINUX - build_info_set_status(BIB_FEATURE_BUILT_FOR, true); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e3eb44f6b418..964d2a574cb7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10094,8 +10094,6 @@ with pkgs; withCloud = !stdenv.isDarwin; withCloudUi = true; }; - # Exposed here so the bots can auto-upgrade it - netdata-go-plugins = callPackage ../tools/system/netdata/go.d.plugin.nix { }; netsurf = recurseIntoAttrs (callPackage ../applications/networking/browsers/netsurf { }); netsurf-browser = netsurf.browser; From 17f3d2047802989e9de6f54e85d2002cea7dcfd5 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 24 Mar 2024 16:54:31 +0100 Subject: [PATCH 02/16] python3Packages.netdata-pandas: init at 0.0.41 A helper library to pull data from the netdata REST API into a pandas dataframe. Signed-off-by: Raito Bezarius --- .../python-modules/netdata-pandas/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/netdata-pandas/default.nix diff --git a/pkgs/development/python-modules/netdata-pandas/default.nix b/pkgs/development/python-modules/netdata-pandas/default.nix new file mode 100644 index 000000000000..01fb2d65c65c --- /dev/null +++ b/pkgs/development/python-modules/netdata-pandas/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, pandas +, requests +, trio +, asks +}: + +buildPythonPackage rec { + pname = "netdata-pandas"; + version = "0.0.41"; + pyproject = true; + + src = fetchFromGitHub { + owner = "netdata"; + repo = "netdata-pandas"; + rev = "v${version}"; + hash = "sha256-AXt8BKWyM3glm5hrRryb+vBzs3z2x61HhbR6DDZkh9o="; + }; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + pandas + requests + trio + asks + ]; + + pythonImportsCheck = [ "netdata_pandas" ]; + + meta = with lib; { + description = "A helper library to pull data from the netdata REST API into a pandas dataframe."; + homepage = "https://github.com/netdata/netdata-pandas"; + license = licenses.asl20; + maintainers = with maintainers; [ raitobezarius ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 092730d89008..566f23625da4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8674,6 +8674,8 @@ self: super: with self; { netdata = callPackage ../development/python-modules/netdata { }; + netdata-pandas = callPackage ../development/python-modules/netdata-pandas { }; + netdisco = callPackage ../development/python-modules/netdisco { }; nethsm = callPackage ../development/python-modules/nethsm { }; From 4ad89957373b40a5558f52f7c098400e3e842fc0 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 24 Mar 2024 16:54:51 +0100 Subject: [PATCH 03/16] python3Packages.changefinder: init at unstable-2024-03-24 Online changepoint detection. Signed-off-by: Raito Bezarius --- .../python-modules/changefinder/default.nix | 40 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/changefinder/default.nix diff --git a/pkgs/development/python-modules/changefinder/default.nix b/pkgs/development/python-modules/changefinder/default.nix new file mode 100644 index 000000000000..b7f49ccce54f --- /dev/null +++ b/pkgs/development/python-modules/changefinder/default.nix @@ -0,0 +1,40 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, numpy +, scipy +, statsmodels +}: + +buildPythonPackage { + pname = "changefinder"; + version = "unstable-2024-03-24"; + pyproject = true; + + src = fetchFromGitHub { + owner = "shunsukeaihara"; + repo = "changefinder"; + rev = "58c8c32f127b9e46f9823f36221f194bdb6f3f8b"; + hash = "sha256-1If0gIsMU8673fKSSHVMvDgR1UnYgM/4HiyvZJ9T6VM="; + }; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + numpy + scipy + statsmodels + ]; + + pythonImportsCheck = [ "changefinder" ]; + + meta = with lib; { + description = "Online Change-Point Detection library based on ChangeFinder algorithm"; + homepage = "https://github.com/shunsukeaihara/changefinder"; + license = licenses.mit; + maintainers = with maintainers; [ raitobezarius ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 566f23625da4..0f80f2f39265 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2064,6 +2064,8 @@ self: super: with self; { chameleon = callPackage ../development/python-modules/chameleon { }; + changefinder = callPackage ../development/python-modules/changefinder { }; + channels = callPackage ../development/python-modules/channels { }; channels-redis = callPackage ../development/python-modules/channels-redis { }; From 38cdab1f929fa8b3788c4db82af279dcdcc8938c Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 24 Mar 2024 16:57:26 +0100 Subject: [PATCH 04/16] nixos/netdata: add debugfs, logs-management, network-viewer support Those require some capabilities. Signed-off-by: Raito Bezarius --- nixos/modules/services/monitoring/netdata.nix | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix index 90e00e91deed..09bd06ed4895 100644 --- a/nixos/modules/services/monitoring/netdata.nix +++ b/nixos/modules/services/monitoring/netdata.nix @@ -13,6 +13,9 @@ let ln -s /run/wrappers/bin/slabinfo.plugin $out/libexec/netdata/plugins.d/slabinfo.plugin ln -s /run/wrappers/bin/freeipmi.plugin $out/libexec/netdata/plugins.d/freeipmi.plugin ln -s /run/wrappers/bin/systemd-journal.plugin $out/libexec/netdata/plugins.d/systemd-journal.plugin + ln -s /run/wrappers/bin/logs-management.plugin $out/libexec/netdata/plugins.d/logs-management.plugin + ln -s /run/wrappers/bin/network-viewer.plugin $out/libexec/netdata/plugins.d/network-viewer.plugin + ln -s /run/wrappers/bin/debugfs.plugin $out/libexec/netdata/plugins.d/debugfs.plugin ''; plugins = [ @@ -308,6 +311,14 @@ in { permissions = "u+rx,g+x,o-rwx"; }; + "debugfs.plugin" = { + source = "${cfg.package}/libexec/netdata/plugins.d/debugfs.plugin.org"; + capabilities = "cap_dac_read_search+ep"; + owner = cfg.user; + group = cfg.group; + permissions = "u+rx,g+x,o-rwx"; + }; + "cgroup-network" = { source = "${cfg.package}/libexec/netdata/plugins.d/cgroup-network.org"; capabilities = "cap_setuid+ep"; @@ -332,6 +343,14 @@ in { permissions = "u+rx,g+x,o-rwx"; }; + "logs-management.plugin" = { + source = "${cfg.package}/libexec/netdata/plugins.d/logs-management.plugin.org"; + capabilities = "cap_dac_read_search,cap_syslog+ep"; + owner = cfg.user; + group = cfg.group; + permissions = "u+rx,g+x,o-rwx"; + }; + "slabinfo.plugin" = { source = "${cfg.package}/libexec/netdata/plugins.d/slabinfo.plugin.org"; capabilities = "cap_dac_override+ep"; @@ -348,6 +367,14 @@ in { group = cfg.group; permissions = "u+rx,g+x,o-rwx"; }; + } // optionalAttrs (cfg.package.withNetworkViewer) { + "network-viewer.plugin" = { + source = "${cfg.package}/libexec/netdata/plugins.d/network-viewer.plugin.org"; + capabilities = "cap_sys_admin,cap_dac_read_search,cap_sys_ptrace+ep"; + owner = cfg.user; + group = cfg.group; + permissions = "u+rx,g+x,o-rwx"; + }; }; security.pam.loginLimits = [ From 0794ea59cd12d52bc4cf0eb1f556306d659b4988 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 24 Mar 2024 16:57:59 +0100 Subject: [PATCH 05/16] nixos/netdata: add default programs for netdata (NVMe, WiFi, APCs) Netdata is zero-config, so we should provide some *default* packages. If the closure size is a problem for you, reach out to maintainers. Signed-off-by: Raito Bezarius --- nixos/modules/services/monitoring/netdata.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix index 09bd06ed4895..6e1e5d5e3c22 100644 --- a/nixos/modules/services/monitoring/netdata.nix +++ b/nixos/modules/services/monitoring/netdata.nix @@ -216,6 +216,10 @@ in { which procps bash + nvme-cli # for go.d + iw # for charts.d + apcupsd # for charts.d + # TODO: firehol # for FireQoS -- this requires more NixOS module support. util-linux # provides logger command; required for syslog health alarms ]) ++ lib.optional cfg.python.enable (pkgs.python3.withPackages cfg.python.extraPackages) From 3386a3aab0d20f52ce77db76e564a43972f4c42c Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 24 Mar 2024 16:58:39 +0100 Subject: [PATCH 06/16] nixos/netdata: introduce `recommendedPythonPackages` This option furthers the "zero configuration" reputation of netdata by collecting some Python packages available in nixpkgs and offering them to the module. It is disabled by default. Signed-off-by: Raito Bezarius --- nixos/modules/services/monitoring/netdata.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix index 6e1e5d5e3c22..f604a6835b08 100644 --- a/nixos/modules/services/monitoring/netdata.nix +++ b/nixos/modules/services/monitoring/netdata.nix @@ -89,6 +89,14 @@ in { Whether to enable python-based plugins ''; }; + recommendedPythonPackages = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + Whether to enable a set of recommended Python plugins + by installing extra Python packages. + ''; + }; extraPackages = mkOption { type = types.functionTo (types.listOf types.package); default = ps: []; @@ -201,6 +209,17 @@ in { } ]; + # Includes a set of recommended Python plugins in exchange of imperfect disk consumption. + services.netdata.python.extraPackages = lib.mkIf cfg.python.recommendedPythonPackages (ps: [ + ps.requests + ps.pandas + ps.numpy + ps.psycopg2 + ps.python-ldap + ps.netdata-pandas + ps.changefinder + ]); + services.netdata.configDir.".opt-out-from-anonymous-statistics" = mkIf (!cfg.enableAnalyticsReporting) (pkgs.writeText ".opt-out-from-anonymous-statistics" ""); environment.etc."netdata/netdata.conf".source = configFile; environment.etc."netdata/conf.d".source = configDirectory; From 1cfb30fbdb49128a32aaae819b8ca9ea9fa28c99 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 24 Mar 2024 16:59:06 +0100 Subject: [PATCH 07/16] nixos/netdata: depends on suid-sgid-wrappers Netdata is critically dependent on working wrappers, thus, we ensure that the service was successful. Signed-off-by: Raito Bezarius --- nixos/modules/services/monitoring/netdata.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix index f604a6835b08..969fb81ab8ff 100644 --- a/nixos/modules/services/monitoring/netdata.nix +++ b/nixos/modules/services/monitoring/netdata.nix @@ -226,7 +226,9 @@ in { systemd.services.netdata = { description = "Real time performance monitoring"; - after = [ "network.target" ]; + after = [ "network.target" "suid-sgid-wrappers.service" ]; + # No wrapper means no "useful" netdata. + requires = [ "suid-sgid-wrappers.service" ]; wantedBy = [ "multi-user.target" ]; path = (with pkgs; [ curl From 32a8884ba4f75a38916f82c34cac8ba09fbfab8d Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 24 Mar 2024 16:59:24 +0100 Subject: [PATCH 08/16] nixos/tests/netdata: use recommended python packages To maximize the testing surface. Signed-off-by: Raito Bezarius --- nixos/tests/netdata.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/tests/netdata.nix b/nixos/tests/netdata.nix index e3438f63404e..df4d342905c6 100644 --- a/nixos/tests/netdata.nix +++ b/nixos/tests/netdata.nix @@ -11,7 +11,10 @@ import ./make-test-python.nix ({ pkgs, ...} : { { pkgs, ... }: { environment.systemPackages = with pkgs; [ curl jq netdata ]; - services.netdata.enable = true; + services.netdata = { + enable = true; + python.recommendedPythonPackages = true; + }; }; }; From c1429c606ffd924c6bba267b17703c01ee509d1f Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Mon, 15 Apr 2024 17:48:53 +0200 Subject: [PATCH 09/16] netdata: 1.45.0 -> 1.45.3 https://github.com/netdata/netdata/releases/tag/v1.45.3 --- pkgs/tools/system/netdata/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index 775a425edb91..ca3d726ccdb4 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -20,8 +20,7 @@ }: stdenv.mkDerivation rec { - # Don't forget to update go.d.plugin.nix as well - version = "1.45.0"; + version = "1.45.3"; pname = "netdata"; src = fetchFromGitHub { @@ -29,8 +28,9 @@ stdenv.mkDerivation rec { repo = "netdata"; rev = "v${version}"; hash = if withCloudUi - then "sha256-AyhS5vwGZLnc+xmf9Qvk2v8rTzhHSUe7LpAbwRYjrKM=" - else "sha256-11UHXPnXC4pzK/oXOZJ7f9X86EV9uHOvMtOCnxTV86U="; + then "sha256-QJqfKo5UFMoACHbVr1Dd9jMo0xkjrW3gUnF25tUvzk8=" + # we delete the v2 GUI after fetching + else "sha256-JzCepVfuf6uu/GuGkwnTYeeW1TxmMuPkgS0203pG8YE="; fetchSubmodules = true; # Remove v2 dashboard distributed under NCUL1. Make sure an empty From f058c122ee4d215b2e9b17fb2e0422822a6f27c7 Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Tue, 16 Apr 2024 08:09:52 +0200 Subject: [PATCH 10/16] nixos/netdata: remove old lib.mdDoc calls --- nixos/modules/services/monitoring/netdata.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix index 969fb81ab8ff..0de0e58a8ae9 100644 --- a/nixos/modules/services/monitoring/netdata.nix +++ b/nixos/modules/services/monitoring/netdata.nix @@ -92,7 +92,7 @@ in { recommendedPythonPackages = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to enable a set of recommended Python plugins by installing extra Python packages. ''; From 6955aab4873e3b2587bb88a8d379860a4a8c1b2f Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Wed, 19 Jun 2024 21:28:59 +0200 Subject: [PATCH 11/16] nixos/netdata: add docker and podman support Podman requires `jq`. Change-Id: Iad2abe1ccf92738da82384f30503f3be6fb11ca7 Signed-off-by: Raito Bezarius --- nixos/modules/services/monitoring/netdata.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix index 0de0e58a8ae9..f5386993e535 100644 --- a/nixos/modules/services/monitoring/netdata.nix +++ b/nixos/modules/services/monitoring/netdata.nix @@ -244,7 +244,9 @@ in { util-linux # provides logger command; required for syslog health alarms ]) ++ lib.optional cfg.python.enable (pkgs.python3.withPackages cfg.python.extraPackages) - ++ lib.optional config.virtualisation.libvirtd.enable (config.virtualisation.libvirtd.package); + ++ lib.optional config.virtualisation.libvirtd.enable config.virtualisation.libvirtd.package + ++ lib.optional config.virtualisation.docker.enable config.virtualisation.docker.package + ++ lib.optionals config.virtualisation.podman.enable [ pkgs.jq config.virtualisation.podman.package ]; environment = { PYTHONPATH = "${cfg.package}/libexec/netdata/python.d/python_modules"; NETDATA_PIPENAME = "/run/netdata/ipc"; @@ -411,6 +413,8 @@ in { ${defaultUser} = { group = defaultUser; isSystemUser = true; + extraGroups = lib.optional config.virtualisation.docker.enable "docker" + ++ lib.optional config.virtualisation.podman.enable "podman"; }; }; From aaccbed9fbdfed8f6ec9efe1d0895023460b879f Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Wed, 19 Jun 2024 21:30:04 +0200 Subject: [PATCH 12/16] nixos/netdata: add wireguard support CAP_NET_ADMIN is required. Change-Id: I8559e50ccf2d34a4bc7c8f4f2aeafb7771fe751b Signed-off-by: Raito Bezarius --- nixos/modules/services/monitoring/netdata.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix index f5386993e535..8f89408bdea5 100644 --- a/nixos/modules/services/monitoring/netdata.nix +++ b/nixos/modules/services/monitoring/netdata.nix @@ -50,6 +50,7 @@ let defaultUser = "netdata"; + isThereAnyWireGuardTunnels = config.networking.wireguard.enable || lib.any (c: lib.hasAttrByPath [ "netdevConfig" "Kind" ] c && c.netdevConfig.Kind == "wireguard") (builtins.attrValues config.systemd.network.netdevs); in { options = { services.netdata = { @@ -286,6 +287,8 @@ in { # Configuration directory and mode ConfigurationDirectory = "netdata"; ConfigurationDirectoryMode = "0755"; + # AmbientCapabilities + AmbientCapabilities = lib.optional isThereAnyWireGuardTunnels "CAP_NET_ADMIN"; # Capabilities CapabilityBoundingSet = [ "CAP_DAC_OVERRIDE" # is required for freeipmi and slabinfo plugins @@ -299,7 +302,7 @@ in { "CAP_SYS_CHROOT" # is required for cgroups plugin "CAP_SETUID" # is required for cgroups and cgroups-network plugins "CAP_SYSLOG" # is required for systemd-journal plugin - ]; + ] ++ lib.optional isThereAnyWireGuardTunnels "CAP_NET_ADMIN"; # Sandboxing ProtectSystem = "full"; ProtectHome = "read-only"; From cbc4224c860759a135882567cd2af668d39cb148 Mon Sep 17 00:00:00 2001 From: Nikita Pedorich Date: Fri, 10 May 2024 23:04:33 +0900 Subject: [PATCH 13/16] netdata: 1.45.3 -> 1.45.4 --- pkgs/tools/system/netdata/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index ca3d726ccdb4..9e019c0f1b0e 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -20,7 +20,7 @@ }: stdenv.mkDerivation rec { - version = "1.45.3"; + version = "1.45.4"; pname = "netdata"; src = fetchFromGitHub { @@ -28,9 +28,9 @@ stdenv.mkDerivation rec { repo = "netdata"; rev = "v${version}"; hash = if withCloudUi - then "sha256-QJqfKo5UFMoACHbVr1Dd9jMo0xkjrW3gUnF25tUvzk8=" + then "sha256-g/wxKtpNsDw/ZaUokdip39enQHMysJE6pYGsApuL4po=" # we delete the v2 GUI after fetching - else "sha256-JzCepVfuf6uu/GuGkwnTYeeW1TxmMuPkgS0203pG8YE="; + else "sha256-Mkrmvdr19sWzFOkdpt46mcsbA3CNpXy4w8um95xaWlo="; fetchSubmodules = true; # Remove v2 dashboard distributed under NCUL1. Make sure an empty From 80db5facb4b82fd3ffaca358dbcd78825af891f2 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Wed, 19 Jun 2024 21:41:30 +0200 Subject: [PATCH 14/16] netdata: workaround for go.d plugins directory accesses Change-Id: I1731e8f3d2c53dfed8d1be3f74f9219f7cf84a34 Signed-off-by: Raito Bezarius --- pkgs/tools/system/netdata/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index 9e019c0f1b0e..0067f8eb585b 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -65,6 +65,13 @@ stdenv.mkDerivation rec { url = "https://github.com/netdata/netdata/pull/17240/commits/b108df72281633234b731b223d99ec99f1d36adf.patch"; hash = "sha256-tgsnbNY0pxFU3bz1J1qPaAeVsozsk2bpHV2mNy8A9is="; }) + # Allow for go.d plugins to access the right directory. + # Can be removed once > v1.45.4 is released + # https://github.com/netdata/netdata/pull/17661 + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/netdata/netdata/pull/17661.patch"; + sha256 = "sha256-j+mrwkibQio2KO8UnV7sxzCoHmkcsalHNzP+YvrRz74="; + }) ]; # Guard against unused buld-time development inputs in closure. Without From eb5855eb3ce5a14a60fd173b20133dfa3166b8c6 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Wed, 19 Jun 2024 21:42:49 +0200 Subject: [PATCH 15/16] netdata: drop maintenance from raitobezarius Change-Id: If98b9f43825ca4f9a4bd80ad6e0a4fe16c7368dc Signed-off-by: Raito Bezarius --- pkgs/tools/system/netdata/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index 0067f8eb585b..617f40f2bca8 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -153,8 +153,6 @@ stdenv.mkDerivation rec { (lib.cmakeBool "ENABLE_PLUGIN_SYSTEMD_JOURNAL" withSystemdJournal) (lib.cmakeBool "ENABLE_PLUGIN_NETWORK_VIEWER" withNetworkViewer) (lib.cmakeBool "ENABLE_PLUGIN_EBPF" withEbpf) - # raitobezarius: I do not wish to maintain Xen-related things alone, thus, disabled. - # Feel free to open an issue / PR to fix this. (lib.cmakeBool "ENABLE_PLUGIN_XENSTAT" false) (lib.cmakeBool "ENABLE_PLUGIN_CUPS" withCups) (lib.cmakeBool "ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE" withConnPrometheus) @@ -209,6 +207,6 @@ stdenv.mkDerivation rec { license = [ licenses.gpl3Plus ] ++ lib.optionals (withCloudUi) [ licenses.ncul1 ]; platforms = platforms.unix; - maintainers = with maintainers; [ raitobezarius ]; + maintainers = [ ]; }; } From a3beb09a7044cfb45bf5593aa7b6f4f22d491205 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Wed, 19 Jun 2024 23:01:17 +0200 Subject: [PATCH 16/16] netdata: fix v1 dashboard installation Co-authored-by: Izorkin Change-Id: I5a379c8622323d7db4fe01f462627d941687ce22 Signed-off-by: Raito Bezarius --- pkgs/tools/system/netdata/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index 617f40f2bca8..9ddba232de19 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -113,6 +113,10 @@ stdenv.mkDerivation rec { mv $out/libexec/netdata/plugins.d/network-viewer.plugin \ $out/libexec/netdata/plugins.d/network-viewer.plugin.org ''} + ${lib.optionalString (!withCloudUi) '' + rm -rf $out/share/netdata/web/index.html + cp $out/share/netdata/web/v1/index.html $out/share/netdata/web/index.html + ''} ''; preConfigure = lib.optionalString (!stdenv.isDarwin) ''