Skip to content

fish: pick up completion files from other packages - #14526

Merged
dezgeg merged 1 commit into
NixOS:masterfrom
Profpatsch:fish-completions
Apr 9, 2016
Merged

dezgeg merged 1 commit into
NixOS:masterfrom
Profpatsch:fish-completions

Conversation

@Profpatsch

Copy link
Copy Markdown
Member

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.

cc @aszlig

@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @lovek323, @jgillich and @the-kenny to be potential reviewers

Comment thread pkgs/shells/fish/default.nix Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why printf?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the way you're using it explodes even more badly if there's a % in the text.

Also the outer printf (that appends to $out/share/fish/config.fish) is being called with a constant string and makes the file not end in a newline.

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

Copy link
Copy Markdown
Member Author

@dezgeg you are right, I haven’t understood how printf works. I have changed it to echo.

@joachifm

joachifm commented Apr 9, 2016

Copy link
Copy Markdown
Contributor

Happy to merge?

@dezgeg

dezgeg commented Apr 9, 2016

Copy link
Copy Markdown
Contributor

Looks good to me. I don't know anything about fish though.

@dezgeg

dezgeg commented Apr 9, 2016

Copy link
Copy Markdown
Contributor

Well, there appears to be a 👍 from what seems another fish user, so that is covered.

@dezgeg
dezgeg merged commit 03c6434 into NixOS:master Apr 9, 2016
'';

# include programs that bring their own completions
environment.pathsToLink = [ "/share/fish/vendor_completions.d" ];

@solson solson Jun 29, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I set programs.fish.enable = true; and sudo nixos-rebuild switch on the nixos-unstable channel now, presumably because of this line, it fails with:

cannot create directory `/nix/store/m3rrr54qspwiwyzn4gjrys36km6jz1g6-system-path//share/fish/vendor_completions.d': No such file or directory at /nix/store/xz5k60frmvvrj16lf7b0d8h3p0l4l7xw-builder.pl line 186.
builder for ‘/nix/store/bm5q3hs3pnijrjx1yrr647pslmzl986g-system-path.drv’ failed with exit code 2
cannot build derivation ‘/nix/store/z8bwgpzs4wiiv72rm4anc4mx1ixph1w2-nixos-system-conway-16.09pre85931.125ffff.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/z8bwgpzs4wiiv72rm4anc4mx1ixph1w2-nixos-system-conway-16.09pre85931.125ffff.drv’ failed

Any idea what's going on here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this error only occurs if you have no packages containing /share/fish/vendor_completions.d, like me. When I add a package that contains that, like docker, then I do not get the above error.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reported as #16614.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants