Skip to content

Commit f009a35

Browse files
authored
htop: add withVimKeys (#471886)
2 parents 6dc87b3 + b6581cc commit f009a35

File tree

3 files changed

+20
-98
lines changed

3 files changed

+20
-98
lines changed

pkgs/by-name/ht/htop-vim/package.nix

Lines changed: 0 additions & 91 deletions
This file was deleted.

pkgs/by-name/ht/htop/package.nix

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
lib,
33
fetchFromGitHub,
4+
fetchpatch2,
45
stdenv,
56
autoreconfHook,
67
pkg-config,
@@ -11,21 +12,28 @@
1112
lm_sensors,
1213
systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemdLibs,
1314
systemdLibs,
15+
withVimKeys ? false,
1416
}:
1517

1618
assert systemdSupport -> stdenv.hostPlatform.isLinux;
1719

18-
stdenv.mkDerivation rec {
19-
pname = "htop";
20+
stdenv.mkDerivation (finalAttrs: {
21+
pname = "htop" + lib.optionalString withVimKeys "-vim";
2022
version = "3.4.1";
2123

2224
src = fetchFromGitHub {
2325
owner = "htop-dev";
2426
repo = "htop";
25-
tag = version;
27+
tag = finalAttrs.version;
2628
hash = "sha256-fVqQwXbJus2IVE1Bzf3yJJpKK4qcZN/SCTX1XYkiHhU=";
2729
};
2830

31+
patches = lib.optional withVimKeys (fetchpatch2 {
32+
name = "vim-keybindings.patch";
33+
url = "https://aur.archlinux.org/cgit/aur.git/plain/vim-keybindings.patch?h=htop-vim&id=d10f022b3ca1207200187a55f5b116a5bd8224f7";
34+
hash = "sha256-fZDTA2dCOmXxUYD6Wm41q7TxL7fgQOj8a/8yJC7Zags=";
35+
});
36+
2937
# upstream removed pkg-config support and uses dlopen now
3038
postPatch =
3139
let
@@ -72,16 +80,19 @@ stdenv.mkDerivation rec {
7280
'';
7381

7482
meta = {
75-
description = "Interactive process viewer";
76-
homepage = "https://htop.dev";
83+
description =
84+
"Interactive process viewer" + lib.optionalString withVimKeys ", with vim-style keybindings";
85+
homepage =
86+
if withVimKeys then "https://aur.archlinux.org/packages/htop-vim" else "https://htop.dev";
7787
license = lib.licenses.gpl2Only;
7888
platforms = lib.platforms.all;
7989
maintainers = with lib.maintainers; [
8090
rob
8191
relrod
8292
SuperSandro2000
93+
thiagokokada
8394
];
84-
changelog = "https://github.com/htop-dev/htop/blob/${version}/ChangeLog";
95+
changelog = "https://github.com/htop-dev/htop/blob/${finalAttrs.version}/ChangeLog";
8596
mainProgram = "htop";
8697
};
87-
}
98+
})

pkgs/top-level/all-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,8 @@ with pkgs;
10611061
}
10621062
);
10631063

1064+
htop-vim = htop.override { withVimKeys = true; };
1065+
10641066
inherit (callPackages ../tools/networking/iroh/default.nix { })
10651067
iroh-relay
10661068
iroh-dns-server

0 commit comments

Comments
 (0)