summary refs log tree commit diff
path: root/pkgs/tools/misc/fzf
diff options
context:
space:
mode:
authorAlexey Lebedeff <alebedev@mirantis.com>2017-07-28 12:42:28 +0300
committerAlexey Lebedeff <alebedev@mirantis.com>2017-07-28 12:48:11 +0300
commit7723d9935f6a134ce8cc878eb566c6caa784318e (patch)
tree046b82ae3721560db972e12fbb50adab6342e818 /pkgs/tools/misc/fzf
parente10d7655dcc1f4d6ddc97b740ba4de83d345d3bf (diff)
downloadnixpkgs-7723d9935f6a134ce8cc878eb566c6caa784318e.tar
nixpkgs-7723d9935f6a134ce8cc878eb566c6caa784318e.tar.gz
nixpkgs-7723d9935f6a134ce8cc878eb566c6caa784318e.tar.bz2
nixpkgs-7723d9935f6a134ce8cc878eb566c6caa784318e.tar.lz
nixpkgs-7723d9935f6a134ce8cc878eb566c6caa784318e.tar.xz
nixpkgs-7723d9935f6a134ce8cc878eb566c6caa784318e.tar.zst
nixpkgs-7723d9935f6a134ce8cc878eb566c6caa784318e.zip
fzf: add script for finding 'share' folder
So that helper scripts can be easily sourced in interactive shell
configuration. `autojump` package was already present and had the same
requirements for findind a `share` folders, so I took an inspiration
there.

I beleive this is a better alternative to:
- https://github.com/NixOS/nixpkgs/pull/25080
- https://github.com/NixOS/nixpkgs/pull/27058

Replacing `$out/share/shell` with `$bin/share/fzf` was necessary to
prevent dependency loop in produced derivations.
Diffstat (limited to 'pkgs/tools/misc/fzf')
-rw-r--r--pkgs/tools/misc/fzf/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/tools/misc/fzf/default.nix b/pkgs/tools/misc/fzf/default.nix
index 916ba99317e..11bc0ef4d11 100644
--- a/pkgs/tools/misc/fzf/default.nix
+++ b/pkgs/tools/misc/fzf/default.nix
@@ -39,7 +39,15 @@ buildGoPackage rec {
     cp -r $src/man/man1 $man/share/man
     mkdir -p $out/share/vim-plugins
     ln -s $out/share/go/src/github.com/junegunn/fzf $out/share/vim-plugins/${name}
-    cp -R $src/shell $out/share/shell
+
+    cp -R $src/shell $bin/share/fzf
+    cat <<SCRIPT > $bin/bin/fzf-share
+    #!/bin/sh
+    # Run this script to find the fzf shared folder where all the shell
+    # integration scripts are living.
+    echo $bin/share/fzf
+    SCRIPT
+    chmod +x $bin/bin/fzf-share
   '';
 
   meta = with stdenv.lib; {