nvtop: fix build

Use udev over systemd as recommended with the AppImage build.

Fixes #201340
This commit is contained in:
Anthony Roussel 2022-11-16 22:30:28 +01:00
parent 05dd7ec2a3
commit 547f2797b4
No known key found for this signature in database
GPG Key ID: 9DC4987B1A55E75E

View File

@ -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"