depot/pkgs/tools/system/nvidia-system-monitor-qt/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

66 lines
1.6 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, cmake
, qtbase
, wrapQtAppsHook
, makeDesktopItem
, copyDesktopItems
}:
let
# Based in desktop files from official packages:
# https://github.com/congard/nvidia-system-monitor-qt/tree/master/package
desktopItem = makeDesktopItem {
name = "nvidia-system-monitor-qt";
desktopName = "NVIDIA System Monitor";
icon = "qnvsm";
exec = "qnvsm";
categories = [
"System"
"Utility"
"Qt"
];
};
in
stdenv.mkDerivation rec {
pname = "nvidia-system-monitor-qt";
version = "1.5";
src = fetchFromGitHub {
owner = "congard";
repo = "nvidia-system-monitor-qt";
rev = "v${version}";
sha256 = "sha256-VDw5Wp/QFDV1zKF4yz0aR0Hox9KHXZmeAKzKLSlu8Ck=";
};
buildInputs = [ qtbase ];
nativeBuildInputs = [ cmake wrapQtAppsHook copyDesktopItems ];
cmakeFlags = [
"-DIconPath=${placeholder "out"}/share/icons/hicolor/512x512/apps/qnvsm.png"
"-DVersionPrefix=(Nixpkgs)"
];
installPhase = ''
runHook preInstall
install -Dm755 qnvsm $out/bin/qnvsm
install -Dm644 $src/icon.png $out/share/icons/hicolor/512x512/apps/qnvsm.png
runHook postInstall
'';
desktopItems = [ desktopItem ];
meta = rec {
description = "Task Manager for Linux for NVIDIA graphics cards";
homepage = "https://github.com/congard/nvidia-system-monitor-qt";
downloadPage = "${homepage}/releases";
changelog = "${downloadPage}/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ hacker1024 ];
mainProgram = "qnvsm";
platforms = lib.platforms.linux;
};
}