2024-02-29 20:09:43 +00:00
|
|
|
{ lib, ocamlPackages, fetchFromGitHub, python3, dune_3, makeWrapper, poppler_utils, fzf }:
|
2024-02-07 01:22:34 +00:00
|
|
|
|
|
|
|
ocamlPackages.buildDunePackage rec {
|
|
|
|
pname = "docfd";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "2.2.0";
|
2024-02-07 01:22:34 +00:00
|
|
|
|
|
|
|
minimalOCamlVersion = "5.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "darrenldl";
|
|
|
|
repo = "docfd";
|
|
|
|
rev = version;
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-v6V9+/Ra19Xy6nCLe/ODJ1uVBwNkQO4lKcxcr2pmxIY=";
|
2024-02-07 01:22:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ python3 dune_3 makeWrapper ];
|
2024-02-29 20:09:43 +00:00
|
|
|
buildInputs = with ocamlPackages; [ oseq spelll notty nottui lwd cmdliner domainslib digestif yojson eio_main containers-data timedesc ];
|
2024-02-07 01:22:34 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# docfd needs pdftotext from popler_utils to allow pdf search
|
2024-02-29 20:09:43 +00:00
|
|
|
# also fzf for "docfd ?" usage
|
|
|
|
wrapProgram $out/bin/docfd --prefix PATH : "${lib.makeBinPath [ poppler_utils fzf ]}"
|
2024-02-07 01:22:34 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "TUI multiline fuzzy document finder";
|
|
|
|
longDescription = ''
|
2024-02-29 20:09:43 +00:00
|
|
|
TUI multiline fuzzy document finder.
|
|
|
|
Think interactive grep for both text files and PDFs, but word/token based
|
|
|
|
instead of regex and line based, so you can search across lines easily.
|
|
|
|
Docfd aims to provide good UX via integration with common text editors
|
|
|
|
and PDF viewers, so you can jump directly to a search result with a
|
|
|
|
single key press.
|
2024-02-07 01:22:34 +00:00
|
|
|
'';
|
|
|
|
homepage = "https://github.com/darrenldl/docfd";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ chewblacka ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
mainProgram = "docfd";
|
|
|
|
};
|
|
|
|
}
|