about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/zenith/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/system/zenith/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/system/zenith/default.nix31
1 files changed, 19 insertions, 12 deletions
diff --git a/nixpkgs/pkgs/tools/system/zenith/default.nix b/nixpkgs/pkgs/tools/system/zenith/default.nix
index 78091d2d4ab0..4318ba492aee 100644
--- a/nixpkgs/pkgs/tools/system/zenith/default.nix
+++ b/nixpkgs/pkgs/tools/system/zenith/default.nix
@@ -5,28 +5,38 @@
 , IOKit
 , nvidiaSupport ? false
 , makeWrapper
-, llvmPackages
 }:
 
+assert nvidiaSupport -> stdenv.isLinux;
+
 rustPlatform.buildRustPackage rec {
   pname = "zenith";
-  version = "0.13.1";
+  version = "0.14.0";
 
   src = fetchFromGitHub {
     owner = "bvaisvil";
     repo = pname;
     rev = version;
-    sha256 = "sha256-N/DvPVYGM/DjTvKvOlR60q6rvNyfAQlnvFnFG5nbUmQ=";
+    sha256 = "sha256-GrrdE9Ih8x8N2HN+1NfxfthfHbufLAT/Ac+ZZWW5Zg8=";
   };
 
-  cargoSha256 = "sha256-Y/vvRJpv82Uc+Bu3lbZxRsu4TL6sAjz5AWHAHkwh98Y=";
+  # remove cargo config so it can find the linker on aarch64-linux
+  postPatch = ''
+    rm .cargo/config
+  '';
 
-  nativeBuildInputs = [ llvmPackages.clang ] ++ lib.optional nvidiaSupport makeWrapper;
-  buildInputs = [ llvmPackages.libclang ] ++ lib.optionals stdenv.isDarwin [ IOKit ];
+  cargoLock = {
+    lockFile = ./Cargo.lock;
+    outputHashes = {
+      "heim-0.1.0-rc.1" = "sha256-TKEG0YxF44wLz+qxpS/VfRKucqyl97t3PDxjPajbD58=";
+      "sysinfo-0.15.1" = "sha256-faMxXEHL7DFQLYrAJ+yBL6yiepZotofPF2+SizGQj4A=";
+    };
+  };
 
-  buildFeatures = lib.optional nvidiaSupport "nvidia";
+  nativeBuildInputs = [ rustPlatform.bindgenHook ] ++ lib.optional nvidiaSupport makeWrapper;
+  buildInputs = lib.optionals stdenv.isDarwin [ IOKit ];
 
-  LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
+  buildFeatures = lib.optional nvidiaSupport "nvidia";
 
   postInstall = lib.optionalString nvidiaSupport ''
     wrapProgram $out/bin/zenith \
@@ -34,14 +44,11 @@ rustPlatform.buildRustPackage rec {
   '';
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
     description = "Sort of like top or htop but with zoom-able charts, network, and disk usage"
       + lib.optionalString nvidiaSupport ", and NVIDIA GPU usage";
     homepage = "https://github.com/bvaisvil/zenith";
     license = licenses.mit;
     maintainers = with maintainers; [ bbigras ];
-    # doesn't build on aarch64 https://github.com/bvaisvil/zenith/issues/19
-    # see https://github.com/NixOS/nixpkgs/pull/88616
-    platforms = platforms.x86;
+    platforms = platforms.unix;
   };
 }