about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/amdgpu_top/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/system/amdgpu_top/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/system/amdgpu_top/default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/system/amdgpu_top/default.nix b/nixpkgs/pkgs/tools/system/amdgpu_top/default.nix
new file mode 100644
index 000000000000..f6397fa28ce1
--- /dev/null
+++ b/nixpkgs/pkgs/tools/system/amdgpu_top/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, libdrm
+, libX11
+, libGL
+, wayland
+, wayland-protocols
+, libxkbcommon
+, libXrandr
+, libXi
+, libXcursor
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "amdgpu_top";
+  version = "0.1.9";
+
+  src = fetchFromGitHub {
+    owner = "Umio-Yasuno";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-RR+YK8LyrPz7Pfv8moSOPei+56088lhoz8HxoB6+0B8=";
+  };
+
+  cargoLock.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 ];
+  };
+}