nixpkgs-immich/pkgs/tools/system/amdgpu_top/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2024-09-17 10:23:40 -06:00
{ lib
, rustPlatform
, fetchFromGitHub
, libdrm
, libX11
, libGL
, wayland
, wayland-protocols
, libxkbcommon
, libXrandr
, libXi
, libXcursor
}:
rustPlatform.buildRustPackage rec {
pname = "amdgpu_top";
version = "0.8.5";
src = fetchFromGitHub {
owner = "Umio-Yasuno";
repo = pname;
rev = "v${version}";
hash = "sha256-n1nOlFXI8UCJxEgbuSbmMUhkZaLS3D4jGQdKH82WGc8=";
};
cargoLock = {
outputHashes = {
"libdrm_amdgpu_sys-0.7.3" = "sha256-4bwbwVoNV2yroh6OLNxBq8gKaFJtoin/b9xaRdh9QOk=";
};
lockFile = ./Cargo.lock;
};
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";
homepage = "https://github.com/Umio-Yasuno/amdgpu_top";
changelog = "https://github.com/Umio-Yasuno/amdgpu_top/releases";
license = licenses.mit;
maintainers = with maintainers; [ geri1701 ];
platforms = platforms.linux;
mainProgram = "amdgpu_top";
};
}