3
0
Fork 0
forked from mirrors/nixpkgs

fish: pick up completion files from other packages

Some packages bring their own completions in
/share/fish/vendor_completions.d. Now they are picked up by fish from
every path in NIX_PROFILES.
This commit is contained in:
Profpatsch 2016-04-08 04:13:41 +02:00
parent 9f1576313d
commit a011083cda
3 changed files with 7 additions and 1 deletions

View file

@ -101,6 +101,9 @@ in
end
'';
# include programs that bring their own completions
environment.pathsToLink = [ "/share/fish/vendor_completions.d" ];
environment.systemPackages = [ pkgs.fish ];
environment.shells = [

View file

@ -59,6 +59,9 @@ stdenv.mkDerivation rec {
'' + ''
sed -i "s|/sbin /usr/sbin||" \
"$out/share/fish/functions/__fish_complete_subcommand_root.fish"
# make fish pick up completions from nix profile
echo "set fish_complete_path (echo \$NIX_PROFILES | tr ' ' '\n')\"/share/fish/vendor_completions.d\" \$fish_complete_path" >> $out/share/fish/config.fish
'';
meta = with stdenv.lib; {

View file

@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
preInstall = ''
mkdir -p "$out/share/bash-completion/completions"
mkdir -p "$out/share/zsh/site-functions"
mkdir -p "$out/share/fish/completions"
mkdir -p "$out/share/fish/vendor_completions.d"
'';
installFlags = [ "PREFIX=$(out)" ];