about summary refs log tree commit diff
path: root/pkgs/applications/file-managers
diff options
context:
space:
mode:
authorzendo <linzway@qq.com>2023-03-28 11:38:05 +0800
committerzendo <linzway@qq.com>2023-03-28 11:42:10 +0800
commite700b7ab98d9fe1385b8dec2fd2120a18601c142 (patch)
tree625d71ca01c66c487132a01c18e3ce3f54fbaa76 /pkgs/applications/file-managers
parente3eeeecadd5e6ef055a83c5eaed8a660b5b464dd (diff)
downloadnixlib-e700b7ab98d9fe1385b8dec2fd2120a18601c142.tar
nixlib-e700b7ab98d9fe1385b8dec2fd2120a18601c142.tar.gz
nixlib-e700b7ab98d9fe1385b8dec2fd2120a18601c142.tar.bz2
nixlib-e700b7ab98d9fe1385b8dec2fd2120a18601c142.tar.lz
nixlib-e700b7ab98d9fe1385b8dec2fd2120a18601c142.tar.xz
nixlib-e700b7ab98d9fe1385b8dec2fd2120a18601c142.tar.zst
nixlib-e700b7ab98d9fe1385b8dec2fd2120a18601c142.zip
ctpv: 1.0 -> 1.1
Diffstat (limited to 'pkgs/applications/file-managers')
-rw-r--r--pkgs/applications/file-managers/lf/ctpv.nix53
1 files changed, 38 insertions, 15 deletions
diff --git a/pkgs/applications/file-managers/lf/ctpv.nix b/pkgs/applications/file-managers/lf/ctpv.nix
index 36a01078831a..d1e4a6633730 100644
--- a/pkgs/applications/file-managers/lf/ctpv.nix
+++ b/pkgs/applications/file-managers/lf/ctpv.nix
@@ -1,38 +1,61 @@
 { lib
-, pkgs
-, file
-, openssl
 , stdenv
 , fetchFromGitHub
-, waylandSupport ? stdenv.isLinux
-, x11Support ? stdenv.isLinux
+, makeWrapper
+, file
+, openssl
+, atool
+, bat
+, chafa
+, delta
+, ffmpeg
+, ffmpegthumbnailer
+, fontforge
+, glow
+, imagemagick
+, jq
+, ueberzug
 }:
 
 stdenv.mkDerivation rec {
   pname = "ctpv";
-  version = "1.0";
+  version = "1.1";
 
   src = fetchFromGitHub {
     owner = "NikitaIvanovV";
-    repo = "${pname}";
+    repo = pname;
     rev = "v${version}";
-    hash = "sha256-0OuskRCBVm8vMd2zH5u5EPABmCOlEv5N4ZZMdc7bAwM=";
+    hash = "sha256-3BQi4m44hBmPkJBFNCg6d9YKRbDZwLxdzBb/NDWTQP4=";
   };
 
-  nativeBuildInputs = [
+  nativeBuildInputs = [ makeWrapper ];
+
+  buildInputs = [
     file # libmagic
     openssl
   ];
 
-  buildInputs = with pkgs; [
-    ffmpegthumbnailer ffmpeg
-  ] ++ lib.optionals waylandSupport [ chafa ]
-    ++ lib.optionals x11Support [ ueberzug ];
-
   makeFlags = [ "PREFIX=$(out)" ];
 
+  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
+      ]}";
+  '';
+
   meta = with lib; {
-    description = "Image previews for lf (list files) file manager";
+    description = "File previewer for a terminal";
     homepage = "https://github.com/NikitaIvanovV/ctpv";
     license = licenses.mit;
     platforms = platforms.linux;