summary refs log tree commit diff
diff options
context:
space:
mode:
authorSymphorien Gibol <symphorien+git@xlumurb.eu>2018-07-11 17:05:51 +0200
committerSymphorien Gibol <symphorien+git@xlumurb.eu>2018-07-24 15:02:48 +0200
commit10436a707a45f540e10d6b0cb5a2c075dff1fc66 (patch)
tree437ffa4948cc4e0502cb28fe87a51a7d504676a8
parentcc700ad55b3fc4bc257826b3167c3a1247b50a5b (diff)
downloadnixlib-10436a707a45f540e10d6b0cb5a2c075dff1fc66.tar
nixlib-10436a707a45f540e10d6b0cb5a2c075dff1fc66.tar.gz
nixlib-10436a707a45f540e10d6b0cb5a2c075dff1fc66.tar.bz2
nixlib-10436a707a45f540e10d6b0cb5a2c075dff1fc66.tar.lz
nixlib-10436a707a45f540e10d6b0cb5a2c075dff1fc66.tar.xz
nixlib-10436a707a45f540e10d6b0cb5a2c075dff1fc66.tar.zst
nixlib-10436a707a45f540e10d6b0cb5a2c075dff1fc66.zip
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.
-rw-r--r--pkgs/applications/editors/neovim/wrapper.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix
index fa0603255599..a57831ba03c0 100644
--- a/pkgs/applications/editors/neovim/wrapper.nix
+++ b/pkgs/applications/editors/neovim/wrapper.nix
@@ -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
     ''