summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/os-specific/darwin/htop/default.nix21
-rw-r--r--pkgs/top-level/all-packages.nix7
2 files changed, 27 insertions, 1 deletions
diff --git a/pkgs/os-specific/darwin/htop/default.nix b/pkgs/os-specific/darwin/htop/default.nix
new file mode 100644
index 000000000000..65e8b09db348
--- /dev/null
+++ b/pkgs/os-specific/darwin/htop/default.nix
@@ -0,0 +1,21 @@
+{ fetchurl, stdenv, ncurses, autoconf, automake }:
+
+stdenv.mkDerivation rec {
+  name = "htop-0.8.2.2";
+
+  src = fetchurl {
+    url = "https://github.com/max-horvath/htop-osx/archive/0.8.2.2.tar.gz";
+    sha256 = "0qxibadn2lfqn10a5jmkv8r5ljfs0vaaa4j6psd7ppxa2w6bx5li";
+  };
+
+  buildInputs = [ autoconf automake ncurses ];
+
+  preConfigure = "./autogen.sh";
+
+  meta = {
+    description = "An interactive process viewer for Mac OS X";
+    homepage = "https://github.com/max-horvath/htop-osx";
+    platforms = stdenv.lib.platforms.darwin;
+    maintainers = with stdenv.lib.maintainers; [ joelteon ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 7e2883d45c4c..65390f09a424 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7054,7 +7054,12 @@ let
 
   hostapd = callPackage ../os-specific/linux/hostapd { };
 
-  htop = callPackage ../os-specific/linux/htop { };
+  htop =
+    if stdenv.isLinux then
+      callPackage ../os-specific/linux/htop { }
+    else if stdenv.isDarwin then
+      callPackage ../os-specific/darwin/htop { }
+    else null;
 
   # GNU/Hurd core packages.
   gnu = recurseIntoAttrs (callPackage ../os-specific/gnu {