From 24543ec1cd4600143b18a1d177f171980b7e7578 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Sat, 21 Dec 2024 09:59:45 +0800 Subject: [PATCH] gpufetch: init at 0.25 --- pkgs/by-name/gp/gpufetch/package.nix | 75 ++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 pkgs/by-name/gp/gpufetch/package.nix diff --git a/pkgs/by-name/gp/gpufetch/package.nix b/pkgs/by-name/gp/gpufetch/package.nix new file mode 100644 index 000000000000..3a40a1df76f7 --- /dev/null +++ b/pkgs/by-name/gp/gpufetch/package.nix @@ -0,0 +1,75 @@ +{ + stdenv, + lib, + fetchFromGitHub, + cmake, + config, + pciutils, + cudaSupport ? config.cudaSupport, + cudaPackages, + installShellFiles, + autoAddDriverRunpath, + gitUpdater, + versionCheckHook, + zlib, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "gpufetch"; + version = "0.25"; + + src = fetchFromGitHub { + owner = "Dr-Noob"; + repo = "gpufetch"; + tag = "v${finalAttrs.version}"; + hash = "sha256-1j23h3TDxa2xu03o37fXfRL3XFYyhMWFGupAlkrYpBY="; + }; + + nativeBuildInputs = + [ + cmake + installShellFiles + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ]; + + buildInputs = + [ + zlib + pciutils + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + cudaPackages.cuda_nvml_dev + ]; + + installPhase = '' + runHook preInstall + + installManPage ${finalAttrs.src}/gpufetch.1 + install -Dm755 ./gpufetch $out/bin/gpufetch + + runHook postInstall + ''; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + + passthru = { + updateScript = gitUpdater { rev-prefix = "v"; }; + }; + + meta = { + description = "Simple yet fancy GPU architecture fetching tool"; + homepage = "https://github.com/Dr-Noob/gpufetch"; + license = lib.licenses.gpl2Only; + mainProgram = "gpufetch"; + maintainers = with lib.maintainers; [ bot-wxt1221 ]; + platforms = [ "x86_64-linux" ]; + }; +})