fzf: add fish hook for NixOS

This commit is contained in:
Patrick Callahan 2017-04-03 16:30:08 -07:00 committed by Jörg Thalheim
parent 855ae68648
commit 3d37af3e8b
No known key found for this signature in database
GPG key ID: CA4106B8D7CC79FA

View file

@ -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