2021-06-09 14:09:54 +03:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, IOKit
|
|
|
|
, nvidiaSupport ? false
|
|
|
|
, makeWrapper
|
2022-04-16 20:39:35 +03:00
|
|
|
, llvmPackages
|
2021-06-09 14:09:54 +03:00
|
|
|
}:
|
2020-03-23 08:25:57 +03:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "zenith";
|
2022-04-16 20:39:35 +03:00
|
|
|
version = "0.13.1";
|
2020-03-23 08:25:57 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bvaisvil";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-04-16 20:39:35 +03:00
|
|
|
sha256 = "sha256-N/DvPVYGM/DjTvKvOlR60q6rvNyfAQlnvFnFG5nbUmQ=";
|
2020-03-23 08:25:57 +03:00
|
|
|
};
|
|
|
|
|
2022-04-16 20:39:35 +03:00
|
|
|
cargoSha256 = "sha256-Y/vvRJpv82Uc+Bu3lbZxRsu4TL6sAjz5AWHAHkwh98Y=";
|
2020-03-23 08:25:57 +03:00
|
|
|
|
2022-04-16 20:39:35 +03:00
|
|
|
nativeBuildInputs = [ llvmPackages.clang ] ++ lib.optional nvidiaSupport makeWrapper;
|
|
|
|
buildInputs = [ llvmPackages.libclang ] ++ lib.optionals stdenv.isDarwin [ IOKit ];
|
2020-04-05 00:20:00 +03:00
|
|
|
|
2021-11-16 02:52:16 +03:00
|
|
|
buildFeatures = lib.optional nvidiaSupport "nvidia";
|
|
|
|
|
2022-04-16 20:39:35 +03:00
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
|
|
|
|
2021-06-09 14:09:54 +03:00
|
|
|
postInstall = lib.optionalString nvidiaSupport ''
|
|
|
|
wrapProgram $out/bin/zenith \
|
|
|
|
--suffix LD_LIBRARY_PATH : "/run/opengl-driver/lib"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 10:54:33 +03:00
|
|
|
meta = with lib; {
|
2021-06-09 14:09:54 +03: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 08:25:57 +03:00
|
|
|
homepage = "https://github.com/bvaisvil/zenith";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ bbigras ];
|
2020-04-04 20:04:53 +03:00
|
|
|
# doesn't build on aarch64 https://github.com/bvaisvil/zenith/issues/19
|
2020-09-12 23:02:13 +03:00
|
|
|
# see https://github.com/NixOS/nixpkgs/pull/88616
|
2020-03-23 08:25:57 +03:00
|
|
|
platforms = platforms.x86;
|
|
|
|
};
|
|
|
|
}
|