Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neovim: take withExtraPackages and add them to the PATH #49498

Closed

Conversation

kalbasit
Copy link
Member

@kalbasit kalbasit commented Oct 31, 2018

Motivation for this change

I use the vim-go plugin which depends on some Go tools such as gorename, gocode etc.. This allows me to override neovim to add packages to make available in the PATH.

I'm not sure if this is the best way, please advise.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@kalbasit
Copy link
Member Author

I discussed this with @Mic92 on IRC, and the best approach is to patch the vim-go plugin instead of vim/neovim to point to the binaries. See discussion below:

10:04 <yl[m]> What's the best way to make available binaries to neovim? I opened https://github.com/NixOS/nixpkgs/pull/49498/files yesterday for my attempt but I'm still unsure if this is the best way. cc clever, infinisil, Mic92.
10:06 <Mic92> yl[m]: adding go to the PATH might be not always the best solution, because there might be different versions required depending on the projects.
10:07 <yl[m]> Mic92: I'm not trying to add go, but goimports, gotools and such. These are required by vim-go vim plugin. Are you suggesting that every project should provide neovim dependencies?
10:08 <Mic92> yl[m]: ok. this might make sense. We probably need a way to propagated packages from plugins to vim's PATH.
10:08 <Mic92> like this was done for ruby.
10:08 <Mic92> the current approach was to patch plugins instead.
10:09 <yl[m]> oh, in the override? 
10:10 <Mic92> yl[m]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/misc/vim-plugins/overrides.nix
10:10 <yl[m]> yea I'm looking at it
10:10 <yl[m]> hmmm
10:11 <Mic92> yl[m]: in theory we could add packages there that are meant for propagating
10:11 <yl[m]> this might work. The vim-go plugin looks for go binaries in $GOBIN. I might just replace `$GOBIN` with the makeBinPath that I have
10:12 <yl[m]> https://github.com/fatih/vim-go/blob/155836d47052ea9c9bac81ba3e937f6f22c8e384/autoload/go/path.vim#L131-L139
10:12 <Mic92> yl[m]: it could be also set in the vimrc configuration
10:12 <Mic92> if that is supported
10:13 <yl[m]> it might `let bin_path = go#config#BinPath()`
10:13 <yl[m]> I have to track down where that is in the config

@kalbasit kalbasit closed this Oct 31, 2018
@kalbasit kalbasit deleted the nixpkgs_neovim-allow-extra-binaries branch October 31, 2018 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants