about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/dcgm/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/dcgm/default.nix')
-rw-r--r--nixpkgs/pkgs/os-specific/linux/dcgm/default.nix28
1 files changed, 11 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/dcgm/default.nix b/nixpkgs/pkgs/os-specific/linux/dcgm/default.nix
index 36c7e3ca6880..32842a8eea0e 100644
--- a/nixpkgs/pkgs/os-specific/linux/dcgm/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/dcgm/default.nix
@@ -104,36 +104,30 @@ in gcc11Stdenv.mkDerivation rec {
 
   hardeningDisable = [ "all" ];
 
+  strictDeps = true;
+
   nativeBuildInputs = [
-    addOpenGLRunpath
+    # autoAddOpenGLRunpathHook does not actually depend on or incur any dependency
+    # of cudaPackages. It merely adds an impure, non-Nix PATH to the RPATHs of
+    # executables that need to use cuda at runtime.
+    cudaPackages_12.autoAddOpenGLRunpathHook
+
     cmake
     git
     python3
+  ];
 
-    jsoncpp-static
-    jsoncpp-static.dev
-    libevent-nossl-static
-    libevent-nossl-static.dev
+  buildInputs = [
     plog.dev # header-only
     tclap_1_4 # header-only
-  ];
 
-  buildInputs = [
     catch2
     fmt_9
+    jsoncpp-static
+    libevent-nossl-static
     yaml-cpp
   ];
 
-  # libcuda.so must be found at runtime because it is supplied by the NVIDIA
-  # driver. autoAddOpenGLRunpathHook breaks on the statically linked exes.
-  postFixup = ''
-    find "$out/bin" "$out/lib" -type f -executable -print0 | while IFS= read -r -d "" f; do
-      if isELF "$f" && [[ $(patchelf --print-needed "$f" || true) == *libcuda.so* ]]; then
-        addOpenGLRunpath "$f"
-      fi
-    done
-  '';
-
   disallowedReferences = lib.concatMap (x: x.pkgSet) cudaPackageSetByVersion;
 
   meta = with lib; {