neovim wrapper: do not unset PYTHONPATH

This solves the following bug:
opening neovim in nix-shell -p pythonPackages.numpy does not enable to
run successfully
:!python -c "import numpy"
because the PYTHONPATH is wiped by the neovim wrapper.

This wiping is necessary for the python providers, though, otherwise a
python2 nix-shell will make the python3 provider read python2 files.

We wrap the providers only, instead of neovim as whole.
This commit is contained in:
Symphorien Gibol 2018-07-11 17:05:51 +02:00
parent cc700ad55b
commit 10436a707a

View file

@ -63,7 +63,6 @@ let
--cmd \"${if withPython then "let g:python_host_prog='$out/bin/nvim-python'" else "let g:loaded_python_provider = 1"}\" \
--cmd \"${if withPython3 then "let g:python3_host_prog='$out/bin/nvim-python3'" else "let g:loaded_python3_provider = 1"}\" \
--cmd \"${if withRuby then "let g:ruby_host_prog='$out/bin/nvim-ruby'" else "let g:loaded_ruby_provider=1"}\" " \
--unset PYTHONPATH \
${optionalString withRuby '' --suffix PATH : ${rubyEnv}/bin --set GEM_HOME ${rubyEnv}/${rubyEnv.ruby.gemPath}'' }
''
@ -75,9 +74,9 @@ let
--replace 'Name=Neovim' 'Name=WrappedNeovim'
''
+ optionalString withPython ''
ln -s ${pythonEnv}/bin/python $out/bin/nvim-python
makeWrapper ${pythonEnv}/bin/python $out/bin/nvim-python --unset PYTHONPATH
'' + optionalString withPython3 ''
ln -s ${python3Env}/bin/python3 $out/bin/nvim-python3
makeWrapper ${python3Env}/bin/python3 $out/bin/nvim-python3 --unset PYTHONPATH
'' + optionalString withRuby ''
ln -s ${rubyEnv}/bin/neovim-ruby-host $out/bin/nvim-ruby
''