16 src = fetchFromGitHub {
20 hash = "sha256-m/RtAjqB6YTwmzCUdKQx/e7vxqJOu1Y1N0u28i8gwEs=";
23 vendorHash = "sha256-4VAAka9FvKuoDZ1E1v9Es3r00GZeG8Jp4pJONYpB/t8=";
27 outputs = [ "out" "man" ];
29 nativeBuildInputs = [ installShellFiles ];
31 buildInputs = [ ncurses ];
34 "-s" "-w" "-X main.version=${version} -X main.revision=${src.rev}"
37 # The vim plugin expects a relative path to the binary; patch it to abspath.
39 sed -i -e "s|expand('<sfile>:h:h')|'$out'|" plugin/fzf.vim
41 if ! grep -q $out plugin/fzf.vim; then
42 echo "Failed to replace vim base_dir path with $out"
46 # fzf-tmux depends on bc
47 substituteInPlace bin/fzf-tmux \
48 --replace-fail "bc" "${lib.getExe bc}"
52 install bin/fzf-tmux $out/bin
54 installManPage man/man1/fzf.1 man/man1/fzf-tmux.1
56 install -D plugin/* -t $out/share/vim-plugins/fzf/plugin
57 mkdir -p $out/share/nvim
58 ln -s $out/share/vim-plugins/fzf $out/share/nvim/site
60 # Install shell integrations
61 install -D shell/* -t $out/share/fzf/
62 install -D shell/key-bindings.fish $out/share/fish/vendor_functions.d/fzf_key_bindings.fish
63 mkdir -p $out/share/fish/vendor_conf.d
64 cat << EOF > $out/share/fish/vendor_conf.d/load-fzf-key-bindings.fish
65 status is-interactive; or exit 0
69 cat <<SCRIPT > $out/bin/fzf-share
71 # Run this script to find the fzf shared folder where all the shell
72 # integration scripts are living.
75 chmod +x $out/bin/fzf-share
78 passthru.tests.version = testers.testVersion {
83 changelog = "https://github.com/junegunn/fzf/blob/${src.rev}/CHANGELOG.md";
84 description = "Command-line fuzzy finder written in Go";
85 homepage = "https://github.com/junegunn/fzf";
86 license = lib.licenses.mit;
87 maintainers = with lib.maintainers; [ Br1ght0ne ma27 zowoq ];
89 platforms = lib.platforms.unix;