nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 cmake,
6 config,
7 pciutils,
8 cudaSupport ? config.cudaSupport,
9 cudaPackages,
10 installShellFiles,
11 autoAddDriverRunpath,
12 gitUpdater,
13 versionCheckHook,
14 zlib,
15}:
16
17stdenv.mkDerivation (finalAttrs: {
18 pname = "gpufetch";
19 version = "0.25";
20
21 src = fetchFromGitHub {
22 owner = "Dr-Noob";
23 repo = "gpufetch";
24 tag = "v${finalAttrs.version}";
25 hash = "sha256-1j23h3TDxa2xu03o37fXfRL3XFYyhMWFGupAlkrYpBY=";
26 };
27
28 nativeBuildInputs = [
29 cmake
30 installShellFiles
31 ]
32 ++ lib.optionals cudaSupport [
33 cudaPackages.cuda_nvcc
34 autoAddDriverRunpath
35 ];
36
37 buildInputs = [
38 zlib
39 pciutils
40 ]
41 ++ lib.optionals cudaSupport [
42 cudaPackages.cuda_cudart
43 cudaPackages.cuda_nvml_dev
44 ];
45
46 installPhase = ''
47 runHook preInstall
48
49 installManPage ${finalAttrs.src}/gpufetch.1
50 install -Dm755 ./gpufetch $out/bin/gpufetch
51
52 runHook postInstall
53 '';
54
55 nativeInstallCheckInputs = [
56 versionCheckHook
57 ];
58 doInstallCheck = true;
59
60 passthru = {
61 updateScript = gitUpdater { rev-prefix = "v"; };
62 };
63
64 meta = {
65 description = "Simple yet fancy GPU architecture fetching tool";
66 homepage = "https://github.com/Dr-Noob/gpufetch";
67 license = lib.licenses.gpl2Only;
68 mainProgram = "gpufetch";
69 maintainers = with lib.maintainers; [ bot-wxt1221 ];
70 platforms = [ "x86_64-linux" ];
71 };
72})