rocm-smi: add update script and fix url

This commit is contained in:
Sebastian Neubauer 2021-09-08 15:04:31 +02:00
parent 4e89f2a609
commit 52e1574f25

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, wrapPython }:
{ lib, stdenv, fetchFromGitHub, writeScript, cmake, wrapPython }:
stdenv.mkDerivation rec {
pname = "rocm-smi";
@ -42,9 +42,16 @@ stdenv.mkDerivation rec {
wrapPythonProgramsIn $out/bin
'';
passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
version="$(curl -sL "https://api.github.com/repos/RadeonOpenCompute/rocm_smi_lib/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
update-source-version rocm-smi "$version"
'';
meta = with lib; {
description = "System management interface for AMD GPUs supported by ROCm";
homepage = "https://github.com/RadeonOpenCompute/ROC-smi";
homepage = "https://github.com/RadeonOpenCompute/rocm_smi_lib";
license = with licenses; [ mit ];
maintainers = with maintainers; [ lovesegfault ];
platforms = [ "x86_64-linux" ];