2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-04-12 12:48:02 +00:00
|
|
|
, makeWrapper
|
|
|
|
, file
|
|
|
|
, openssl
|
|
|
|
, atool
|
|
|
|
, bat
|
|
|
|
, chafa
|
|
|
|
, delta
|
|
|
|
, ffmpeg
|
|
|
|
, ffmpegthumbnailer
|
|
|
|
, fontforge
|
|
|
|
, glow
|
|
|
|
, imagemagick
|
|
|
|
, jq
|
|
|
|
, ueberzug
|
2023-03-04 12:14:45 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ctpv";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "1.1";
|
2023-03-04 12:14:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NikitaIvanovV";
|
2023-04-12 12:48:02 +00:00
|
|
|
repo = pname;
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "v${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-3BQi4m44hBmPkJBFNCg6d9YKRbDZwLxdzBb/NDWTQP4=";
|
2023-03-04 12:14:45 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [
|
2023-03-04 12:14:45 +00:00
|
|
|
file # libmagic
|
|
|
|
openssl
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2023-04-12 12:48:02 +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
|
|
|
|
]}";
|
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
meta = with lib; {
|
2023-04-12 12:48:02 +00:00
|
|
|
description = "File previewer for a terminal";
|
2023-03-04 12:14:45 +00:00
|
|
|
homepage = "https://github.com/NikitaIvanovV/ctpv";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.wesleyjrz ];
|
|
|
|
};
|
|
|
|
}
|