2021-06-09 11:09:54 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, IOKit
|
|
|
|
, nvidiaSupport ? false
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
2020-03-23 05:25:57 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "zenith";
|
2021-01-13 20:28:38 +00:00
|
|
|
version = "0.12.0";
|
2020-03-23 05:25:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bvaisvil";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-01-13 20:28:38 +00:00
|
|
|
sha256 = "1bn364rmp0q86rd7vgv4n7x09cdf9m4njcaq92jnk85ni6h147ax";
|
2020-03-23 05:25:57 +00:00
|
|
|
};
|
|
|
|
|
2021-05-07 11:00:49 +00:00
|
|
|
cargoSha256 = "0c2mk2bcz4qjyqmf11yqhnhy4pqxr77b3c1gvr5jfmjshx4ff7v2";
|
2020-03-23 05:25:57 +00:00
|
|
|
|
2021-06-09 11:09:54 +00:00
|
|
|
nativeBuildInputs = lib.optional nvidiaSupport makeWrapper;
|
2021-01-15 09:19:50 +00:00
|
|
|
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";
|
|
|
|
|
2021-06-09 11:09:54 +00:00
|
|
|
postInstall = lib.optionalString nvidiaSupport ''
|
|
|
|
wrapProgram $out/bin/zenith \
|
|
|
|
--suffix LD_LIBRARY_PATH : "/run/opengl-driver/lib"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-06-09 11:09:54 +00:00
|
|
|
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;
|
|
|
|
maintainers = with maintainers; [ bbigras ];
|
2020-04-04 17:04:53 +00:00
|
|
|
# doesn't build on aarch64 https://github.com/bvaisvil/zenith/issues/19
|
2020-09-12 20:02:13 +00:00
|
|
|
# see https://github.com/NixOS/nixpkgs/pull/88616
|
2020-03-23 05:25:57 +00:00
|
|
|
platforms = platforms.x86;
|
|
|
|
};
|
|
|
|
}
|