2022-12-31 20:51:34 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-03-28 03:38:05 +00:00
|
|
|
, makeWrapper
|
|
|
|
, file
|
|
|
|
, openssl
|
|
|
|
, atool
|
|
|
|
, bat
|
|
|
|
, chafa
|
|
|
|
, delta
|
|
|
|
, ffmpeg
|
|
|
|
, ffmpegthumbnailer
|
|
|
|
, fontforge
|
|
|
|
, glow
|
|
|
|
, imagemagick
|
|
|
|
, jq
|
|
|
|
, ueberzug
|
2022-12-31 20:51:34 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ctpv";
|
2023-03-28 03:38:05 +00:00
|
|
|
version = "1.1";
|
2022-12-31 20:51:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NikitaIvanovV";
|
2023-03-28 03:38:05 +00:00
|
|
|
repo = pname;
|
2022-12-31 20:51:34 +00:00
|
|
|
rev = "v${version}";
|
2023-03-28 03:38:05 +00:00
|
|
|
hash = "sha256-3BQi4m44hBmPkJBFNCg6d9YKRbDZwLxdzBb/NDWTQP4=";
|
2022-12-31 20:51:34 +00:00
|
|
|
};
|
|
|
|
|
2023-03-28 03:38:05 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-12-31 20:51:34 +00:00
|
|
|
file # libmagic
|
|
|
|
openssl
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2023-03-28 03:38:05 +00:00
|
|
|
preFixup = ''
|
|
|
|
wrapProgram $out/bin/ctpv \
|
|
|
|
--prefix PATH ":" "${lib.makeBinPath [
|
|
|
|
atool # for archive files
|
|
|
|
bat
|
|
|
|
chafa # for image files on Wayland
|
|
|
|
delta # for diff files
|
|
|
|
ffmpeg
|
|
|
|
ffmpegthumbnailer
|
|
|
|
fontforge
|
|
|
|
glow # for markdown files
|
|
|
|
imagemagick
|
|
|
|
jq # for json files
|
|
|
|
ueberzug # for image files on X11
|
|
|
|
]}";
|
|
|
|
'';
|
|
|
|
|
2022-12-31 20:51:34 +00:00
|
|
|
meta = with lib; {
|
2023-03-28 03:38:05 +00:00
|
|
|
description = "File previewer for a terminal";
|
2022-12-31 20:51:34 +00:00
|
|
|
homepage = "https://github.com/NikitaIvanovV/ctpv";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.wesleyjrz ];
|
|
|
|
};
|
|
|
|
}
|