Skip to content

Commit 4d0c6c6

Browse files
authored
nvimpager: init at 0.9 (#107057)
* nvimpager: init at 0.9 * nvimpager: fixup: doCheck can be overriden with `overrideAttrs` * nvimpager: fixup: use patchShebangs instead of substituteInPlace * nvimpager: fixup: move pandoc to nativeBuildInputs * Fix typo * nvimpager: fixup: run the tests in a pseudo tty * nvimpager: fixup: make all dependencies overridable
1 parent ca8343d commit 4d0c6c6

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

maintainers/maintainer-list.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4942,6 +4942,12 @@
49424942
githubId = 45168934;
49434943
name = "Louis Blin";
49444944
};
4945+
lucc = {
4946+
email = "lucc+nix@posteo.de";
4947+
github = "lucc";
4948+
githubId = 1104419;
4949+
name = "Lucas Hoffmann";
4950+
};
49454951
ldelelis = {
49464952
email = "ldelelis@est.frba.utn.edu.ar";
49474953
github = "ldelelis";
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{ fetchFromGitHub
2+
, stdenv
3+
, ncurses, neovim, procps
4+
, pandoc, lua51Packages, util-linux
5+
}:
6+
7+
stdenv.mkDerivation rec {
8+
pname = "nvimpager";
9+
version = "0.9";
10+
11+
src = fetchFromGitHub {
12+
owner = "lucc";
13+
repo = pname;
14+
rev = "v${version}";
15+
sha256 = "1xy5387szfw0bp8dr7d4z33wd4xva7q219rvz8gc0vvv1vsy73va";
16+
};
17+
18+
buildInputs = [
19+
ncurses # for tput
20+
procps # for nvim_get_proc() which uses ps(1)
21+
];
22+
nativeBuildInputs = [ pandoc ];
23+
24+
makeFlags = [ "PREFIX=$(out)" ];
25+
buildFlags = [ "nvimpager.configured" ];
26+
preBuild = ''
27+
patchShebangs nvimpager
28+
substituteInPlace nvimpager --replace ':-nvim' ':-${neovim}/bin/nvim'
29+
'';
30+
31+
doCheck = true;
32+
checkInputs = [ lua51Packages.busted util-linux neovim ];
33+
checkPhase = ''script -c "busted --lpath './?.lua' test"'';
34+
35+
meta = with stdenv.lib; {
36+
description = "Use neovim as pager";
37+
longDescription = ''
38+
Use neovim as a pager to view manpages, diffs, etc with nvim's syntax
39+
highlighting. Includes a cat mode to print highlighted files to stdout
40+
and a ansi esc mode to highlight ansi escape sequences in neovim.
41+
'';
42+
homepage = "https://github.com/lucc/nvimpager";
43+
license = licenses.bsd2;
44+
platforms = platforms.unix;
45+
maintainers = [ maintainers.lucc ];
46+
};
47+
}

pkgs/top-level/all-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6165,6 +6165,8 @@ in
61656165

61666166
nssmdns = callPackage ../tools/networking/nss-mdns { };
61676167

6168+
nvimpager = callPackage ../tools/misc/nvimpager { };
6169+
61686170
nwdiag = with python3Packages; toPythonApplication nwdiag;
61696171

61706172
nxdomain = python3.pkgs.callPackage ../tools/networking/nxdomain { };

0 commit comments

Comments
 (0)