ch9344: 2.0 -> 0-unstable-2024-11-15 (#354536)
[NixPkgs.git] / pkgs / tools / system / nvidia-system-monitor-qt / default.nix
blob529a02ba35a66254d1ae9cd36c2d071306de02c2
2   stdenv,
3   lib,
4   fetchFromGitHub,
5   cmake,
6   qtbase,
7   wrapQtAppsHook,
8   makeDesktopItem,
9   copyDesktopItems,
12 let
13   # Based in desktop files from official packages:
14   # https://github.com/congard/nvidia-system-monitor-qt/tree/master/package
15   desktopItem = makeDesktopItem {
16     name = "nvidia-system-monitor-qt";
17     desktopName = "NVIDIA System Monitor";
18     icon = "qnvsm";
19     exec = "qnvsm";
20     categories = [
21       "System"
22       "Utility"
23       "Qt"
24     ];
25   };
27 stdenv.mkDerivation rec {
28   pname = "nvidia-system-monitor-qt";
29   version = "1.5";
31   src = fetchFromGitHub {
32     owner = "congard";
33     repo = "nvidia-system-monitor-qt";
34     rev = "v${version}";
35     sha256 = "sha256-VDw5Wp/QFDV1zKF4yz0aR0Hox9KHXZmeAKzKLSlu8Ck=";
36   };
38   buildInputs = [ qtbase ];
39   nativeBuildInputs = [
40     cmake
41     wrapQtAppsHook
42     copyDesktopItems
43   ];
45   cmakeFlags = [
46     "-DIconPath=${placeholder "out"}/share/icons/hicolor/512x512/apps/qnvsm.png"
47     "-DVersionPrefix=(Nixpkgs)"
48   ];
50   installPhase = ''
51     runHook preInstall
53     install -Dm755 qnvsm $out/bin/qnvsm
54     install -Dm644 $src/icon.png $out/share/icons/hicolor/512x512/apps/qnvsm.png
56     runHook postInstall
57   '';
59   desktopItems = [ desktopItem ];
61   meta = rec {
62     description = "Task Manager for Linux for NVIDIA graphics cards";
63     homepage = "https://github.com/congard/nvidia-system-monitor-qt";
64     downloadPage = "${homepage}/releases";
65     changelog = "${downloadPage}/tag/v${version}";
66     license = lib.licenses.mit;
67     maintainers = with lib.maintainers; [ hacker1024 ];
68     mainProgram = "qnvsm";
69     platforms = lib.platforms.linux;
70   };