2020-12-22 09:11:02 +00:00
|
|
|
{ fetchFromGitHub
|
2021-01-11 07:54:33 +00:00
|
|
|
, lib, stdenv
|
2020-12-22 09:11:02 +00:00
|
|
|
, ncurses, neovim, procps
|
2021-06-07 22:27:37 +01:00
|
|
|
, scdoc, lua51Packages, util-linux
|
2020-12-22 09:11:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nvimpager";
|
2021-06-06 17:30:18 +01:00
|
|
|
version = "0.10.4";
|
2020-12-22 09:11:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lucc";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-06-06 17:30:18 +01:00
|
|
|
sha256 = "sha256-0guSL4RvYQFwok7zGuevhQY6DHjnETRLpEIEQfGslcg=";
|
2020-12-22 09:11:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ncurses # for tput
|
|
|
|
procps # for nvim_get_proc() which uses ps(1)
|
|
|
|
];
|
2021-06-07 22:27:37 +01:00
|
|
|
nativeBuildInputs = [ scdoc ];
|
2020-12-22 09:11:02 +00:00
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2021-06-07 22:27:37 +01:00
|
|
|
buildFlags = [ "nvimpager.configured" "nvimpager.1" ];
|
2020-12-22 09:11:02 +00:00
|
|
|
preBuild = ''
|
|
|
|
patchShebangs nvimpager
|
|
|
|
substituteInPlace nvimpager --replace ':-nvim' ':-${neovim}/bin/nvim'
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkInputs = [ lua51Packages.busted util-linux neovim ];
|
2021-06-07 22:27:37 +01:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
script -c "busted --lpath './?.lua' test"
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2020-12-22 09:11:02 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-12-22 09:11:02 +00:00
|
|
|
description = "Use neovim as pager";
|
|
|
|
longDescription = ''
|
|
|
|
Use neovim as a pager to view manpages, diffs, etc with nvim's syntax
|
|
|
|
highlighting. Includes a cat mode to print highlighted files to stdout
|
|
|
|
and a ansi esc mode to highlight ansi escape sequences in neovim.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/lucc/nvimpager";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.lucc ];
|
|
|
|
};
|
|
|
|
}
|