From 05dd7ec2a3d02244d35a4d20786db121dd2a2556 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Wed, 16 Nov 2022 22:15:16 +0100 Subject: [PATCH 1/2] nvtop: add passthru.tests.version --- pkgs/tools/system/nvtop/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/tools/system/nvtop/default.nix b/pkgs/tools/system/nvtop/default.nix index 053437dc3e95..41f84c2a7d6b 100644 --- a/pkgs/tools/system/nvtop/default.nix +++ b/pkgs/tools/system/nvtop/default.nix @@ -6,6 +6,8 @@ , cudatoolkit , libdrm , ncurses +, nvtop +, testers , addOpenGLRunpath , amd ? true , nvidia ? true @@ -54,6 +56,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 = '' From 547f2797b43e72c7440a551b76377fa2231eec63 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Wed, 16 Nov 2022 22:30:28 +0100 Subject: [PATCH 2/2] nvtop: fix build Use udev over systemd as recommended with the AppImage build. Fixes #201340 --- pkgs/tools/system/nvtop/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/nvtop/default.nix b/pkgs/tools/system/nvtop/default.nix index 41f84c2a7d6b..44ecbd39d471 100644 --- a/pkgs/tools/system/nvtop/default.nix +++ b/pkgs/tools/system/nvtop/default.nix @@ -8,16 +8,16 @@ , 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)" \ @@ -39,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"