From de9e53d994e637d217927fa65c3bee319464f32c Mon Sep 17 00:00:00 2001 From: lelgenio Date: Wed, 3 May 2023 16:11:35 -0300 Subject: [PATCH] amdgpu_top: fix GUI mode missing x11 and wayland libs --- pkgs/tools/system/amdgpu_top/default.nix | 34 ++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/amdgpu_top/default.nix b/pkgs/tools/system/amdgpu_top/default.nix index 75dd1bd4ac94..8355486ff540 100644 --- a/pkgs/tools/system/amdgpu_top/default.nix +++ b/pkgs/tools/system/amdgpu_top/default.nix @@ -1,4 +1,16 @@ -{ lib, rustPlatform, fetchFromGitHub, libdrm }: +{ lib +, rustPlatform +, fetchFromGitHub +, libdrm +, libX11 +, libGL +, wayland +, wayland-protocols +, libxkbcommon +, libXrandr +, libXi +, libXcursor +}: rustPlatform.buildRustPackage rec { pname = "amdgpu_top"; @@ -13,7 +25,25 @@ rustPlatform.buildRustPackage rec { cargoLock.lockFile = ./Cargo.lock; - buildInputs = [ libdrm ]; + buildInputs = [ + libdrm + libX11 + libGL + wayland + wayland-protocols + libxkbcommon + libXrandr + libXi + libXcursor + ]; + + postInstall = '' + install -D ./assets/${pname}.desktop -t $out/share/applications/ + ''; + + postFixup = '' + patchelf --set-rpath "${lib.makeLibraryPath buildInputs}" $out/bin/${pname} + ''; meta = with lib; { description = "Tool to display AMDGPU usage";