nixpkgs/pkgs/tools/system/zenith/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.5 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, IOKit
, nvidiaSupport ? false
, makeWrapper
}:
2020-03-23 05:25:57 +00:00
2023-02-02 09:10:44 +00:00
assert nvidiaSupport -> stdenv.isLinux;
2020-03-23 05:25:57 +00:00
rustPlatform.buildRustPackage rec {
pname = "zenith";
version = "0.14.0-unstable-2023-11-21";
2020-03-23 05:25:57 +00:00
src = fetchFromGitHub {
owner = "bvaisvil";
repo = pname;
rev = "0ed09e6a68c1517b4d050f5e3163421718226040";
hash = "sha256-vw/ar2Qi06HxPfPsfcxtfRhMTqY4FCE+7tCfe9sLEv0=";
2020-03-23 05:25:57 +00:00
};
2023-02-02 09:10:44 +00:00
# remove cargo config so it can find the linker on aarch64-linux
postPatch = ''
rm .cargo/config
'';
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"heim-0.1.0-rc.1" = "sha256-TKEG0YxF44wLz+qxpS/VfRKucqyl97t3PDxjPajbD58=";
"sysinfo-0.15.1" = "sha256-faMxXEHL7DFQLYrAJ+yBL6yiepZotofPF2+SizGQj4A=";
};
};
2020-03-23 05:25:57 +00:00
2023-05-26 20:52:21 +00:00
nativeBuildInputs = [ rustPlatform.bindgenHook ] ++ lib.optional nvidiaSupport makeWrapper;
buildInputs = lib.optionals stdenv.isDarwin [ IOKit ];
2020-04-04 21:20:00 +00:00
2021-11-15 23:52:16 +00:00
buildFeatures = lib.optional nvidiaSupport "nvidia";
postInstall = lib.optionalString nvidiaSupport ''
wrapProgram $out/bin/zenith \
--suffix LD_LIBRARY_PATH : "/run/opengl-driver/lib"
'';
meta = with lib; {
description = "Sort of like top or htop but with zoom-able charts, network, and disk usage"
+ lib.optionalString nvidiaSupport ", and NVIDIA GPU usage";
2020-03-23 05:25:57 +00:00
homepage = "https://github.com/bvaisvil/zenith";
license = licenses.mit;
2023-12-04 23:16:17 +00:00
maintainers = with maintainers; [ wegank ];
2023-02-02 09:10:44 +00:00
platforms = platforms.unix;
2020-03-23 05:25:57 +00:00
};
}