git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #27709 from binarin/fzf-share

fzf: add script for finding 'share' folder

commit25bb529245b029f53df6b15b94fcbe9de58017fb authorJörg Thalheim <Mic92@users.noreply.github.com> dateSun 30 Jul 2017, 10:16 (9 years ago) parente9a70cc7723d99
2 files changed+33−7
doc/package-notes.xml+24−6 pkgs/tools/misc/fzf/default.nix+9−1
doc/package-notes.xml+24−6
@@ -366,15 +366,33 @@ it. Place the resulting <filename>package.nix</filename> file into
366366
367367</section>
368368
369−<section xml:id="sec-autojump">
369+<section xml:id="sec-shell-helpers">
370370
371−<title>Autojump</title>
371+<title>Interactive shell helpers</title>
372372
373373<para>
374− autojump needs the shell integration to be useful but unlike other systems,
375− nix doesn't have a standard share directory location. This is why a
376− <command>autojump-share</command> script is shipped that prints the location
377− of the shared folder. This can then be used in the .bashrc like this:
374+ Some packages provide the shell integration to be more useful. But
375+ unlike other systems, nix doesn't have a standard share directory
376+ location. This is why a bunch <command>PACKAGE-share</command>
377+ scripts are shipped that print the location of the corresponding
378+ shared folder.
379+
380+ Current list of such packages is as following:
381+
382+ <itemizedlist>
383+ <listitem>
384+ <para>
385+ <literal>autojump</literal>: <command>autojump-share</command>
386+ </para>
387+ </listitem>
388+ <listitem>
389+ <para>
390+ <literal>fzf</literal>: <command>fzf-share</command>
391+ </para>
392+ </listitem>
393+ </itemizedlist>
394+
395+ E.g. <literal>autojump</literal> can then used in the .bashrc like this:
378396<screen>
379397 source "$(autojump-share)/autojump.bash"
380398</screen>
pkgs/tools/misc/fzf/default.nix+9−1
@@ -39,7 +39,15 @@ buildGoPackage rec {
3939 cp -r $src/man/man1 $man/share/man
4040 mkdir -p $out/share/vim-plugins
4141 ln -s $out/share/go/src/github.com/junegunn/fzf $out/share/vim-plugins/${name}
42− cp -R $src/shell $out/share/shell
42+
43+ cp -R $src/shell $bin/share/fzf
44+ cat <<SCRIPT > $bin/bin/fzf-share
45+ #!/bin/sh
46+ # Run this script to find the fzf shared folder where all the shell
47+ # integration scripts are living.
48+ echo $bin/share/fzf
49+ SCRIPT
50+ chmod +x $bin/bin/fzf-share
4351 '';
4452
4553 meta = with stdenv.lib; {