about summary refs log tree commit diff
path: root/pkgs/tools/system/nvtop/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/nvtop/default.nix')
-rw-r--r--pkgs/tools/system/nvtop/default.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/tools/system/nvtop/default.nix b/pkgs/tools/system/nvtop/default.nix
index 053437dc3e957..44ecbd39d4714 100644
--- a/pkgs/tools/system/nvtop/default.nix
+++ b/pkgs/tools/system/nvtop/default.nix
@@ -6,16 +6,18 @@
 , cudatoolkit
 , libdrm
 , ncurses
+, nvtop
+, testers
+, udev
 , addOpenGLRunpath
 , amd ? true
 , nvidia ? true
-, udev
 }:
 
 let
   pname-suffix = if amd && nvidia then "" else if amd then "-amd" else "-nvidia";
   nvidia-postFixup = "addOpenGLRunpath $out/bin/nvtop";
-  libPath = lib.makeLibraryPath [ libdrm ncurses ];
+  libPath = lib.makeLibraryPath [ libdrm ncurses udev ];
   amd-postFixup = ''
     patchelf \
       --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
@@ -37,6 +39,7 @@ stdenv.mkDerivation rec {
   cmakeFlags = with lib; [
     "-DCMAKE_BUILD_TYPE=Release"
     "-DBUILD_TESTING=ON"
+    "-DUSE_LIBUDEV_OVER_LIBSYSTEMD=ON"
   ] ++ optional nvidia "-DNVML_INCLUDE_DIRS=${cudatoolkit}/include"
   ++ optional nvidia "-DNVML_LIBRARIES=${cudatoolkit}/targets/x86_64-linux/lib/stubs/libnvidia-ml.so"
   ++ optional (!amd) "-DAMDGPU_SUPPORT=OFF"
@@ -54,6 +57,14 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  passthru = {
+    tests.version = testers.testVersion {
+      inherit version;
+      package = nvtop;
+      command = "nvtop --version";
+    };
+  };
+
   meta = with lib; {
     description = "A (h)top like task monitor for AMD, Intel and NVIDIA GPUs";
     longDescription = ''