autojump: include a way to find the share dir

autojump-share is a new script that gives you the path to autojump's
shared directory. It can then be used in the various shell's rc files to
find and source the autojump integration. Eg:

source "$(autojump-share)/autojump.bash"

Fixes #3239

zimbatm 5901a8c6 eecd0640

Changed files
+7 -3
pkgs
tools
misc
autojump
+7 -3
pkgs/tools/misc/autojump/default.nix
···
mkdir -p "$out/etc/bash_completion.d"
cp -v $out/share/autojump/autojump.bash "$out/etc/bash_completion.d"
-
# FIXME: What's the right place for `autojump.zsh'?
-
# This can be used as a workaround in .zshrc:
-
# . $HOME/.nix-profile/share/autojump/autojump.zsh
+
cat <<SCRIPT > $out/bin/autojump-share
+
#!/bin/sh
+
# Run this script to find the autojump shared folder where all the shell
+
# integration scripts are living.
+
echo $out/share/autojump
+
SCRIPT
+
chmod +x $out/bin/autojump-share
'';
meta = {