fzf: add fish hook for NixOS
This commit is contained in:
parent
855ae68648
commit
3d37af3e8b
@ -1,4 +1,4 @@
|
||||
{ stdenv, lib, ncurses, buildGoPackage, fetchFromGitHub }:
|
||||
{ stdenv, lib, ncurses, buildGoPackage, fetchFromGitHub, writeText }:
|
||||
|
||||
buildGoPackage rec {
|
||||
name = "fzf-${version}";
|
||||
@ -16,6 +16,8 @@ buildGoPackage rec {
|
||||
|
||||
outputs = [ "bin" "out" "man" ];
|
||||
|
||||
fishHook = writeText "load-fzf-keybindings.fish" "fzf_key_bindings";
|
||||
|
||||
buildInputs = [ ncurses ];
|
||||
|
||||
goDeps = ./deps.nix;
|
||||
@ -25,6 +27,12 @@ buildGoPackage rec {
|
||||
sed -i -e "s|expand('<sfile>:h:h').'/bin/fzf-tmux'|'$bin/bin/fzf-tmux'|" plugin/fzf.vim
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p $bin/share/fish/vendor_functions.d $bin/share/fish/vendor_conf.d
|
||||
cp $src/shell/key-bindings.fish $bin/share/fish/vendor_functions.d/fzf_key_bindings.fish
|
||||
cp ${fishHook} $bin/share/fish/vendor_conf.d/load-fzf-key-bindings.fish
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
cp $src/bin/fzf-tmux $bin/bin
|
||||
mkdir -p $man/share/man
|
||||
|
Loading…
Reference in New Issue
Block a user