1 { lib, fetchFromGitHub, fetchpatch2, stdenv, autoreconfHook, pkg-config
6 , sensorsSupport ? stdenv.hostPlatform.isLinux, lm_sensors
7 , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
10 assert systemdSupport -> stdenv.hostPlatform.isLinux;
12 stdenv.mkDerivation rec {
16 src = fetchFromGitHub {
20 hash = "sha256-qDhQkzY2zj2yxbgFUXwE0MGEgAFOsAhnapUuetO9WTw=";
24 # See https://github.com/htop-dev/htop/pull/1412
25 # Remove when updating to 3.4.0
27 name = "htop-resolve-configuration-path.patch";
28 url = "https://github.com/htop-dev/htop/commit/0dac8e7d38ec3aeae901a987717b5177986197e4.patch";
29 hash = "sha256-Er1d/yV1fioYfEmXNlLO5ayAyXkyy+IaGSx1KWXvlv0=";
33 nativeBuildInputs = [ autoreconfHook ]
34 ++ lib.optional stdenv.hostPlatform.isLinux pkg-config
37 buildInputs = [ ncurses ]
38 ++ lib.optional stdenv.hostPlatform.isDarwin IOKit
39 ++ lib.optionals stdenv.hostPlatform.isLinux [ libcap libnl ]
40 ++ lib.optional sensorsSupport lm_sensors
41 ++ lib.optional systemdSupport systemd
44 configureFlags = [ "--enable-unicode" "--sysconfdir=/etc" ]
45 ++ lib.optionals stdenv.hostPlatform.isLinux [
47 "--enable-capabilities"
50 ++ lib.optional sensorsSupport "--enable-sensors"
55 optionalPatch = pred: so: lib.optionalString pred "patchelf --add-needed ${so} $out/bin/htop";
56 in lib.optionalString (!stdenv.hostPlatform.isStatic) ''
57 ${optionalPatch sensorsSupport "${lm_sensors}/lib/libsensors.so"}
58 ${optionalPatch systemdSupport "${systemd}/lib/libsystemd.so"}
62 description = "Interactive process viewer";
63 homepage = "https://htop.dev";
64 license = licenses.gpl2Only;
65 platforms = platforms.all;
66 maintainers = with maintainers; [ rob relrod SuperSandro2000 ];
67 changelog = "https://github.com/htop-dev/htop/blob/${version}/ChangeLog";