Unverified Commit 14518370 authored by Matthieu Coudron's avatar Matthieu Coudron Committed by GitHub
Browse files

neovim dont wrap lua path (#500416)

parents ce0546f4 da6e66c2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -252,6 +252,11 @@

- `wrapNeovimUnstable` now sets provider-related configuration in its generated config rather than as wrapper arguments. It should not affect configuration unless you set `wrapRc` to false or are using the `legacyWrapper`.

- neovim lua dependencies are now set in the generated init.lua instead of
  modifying LUA_PATH in the wrapper. Commands run pre-vimrc via `nvim --cmd
  "require'LUA_MODULE'"` may
  not find their lua dependencies anymore. Use `nvim -c "lua require'LUA_MODULE'"` instead to run these commands after loading `init.lua`.

- We now use the upstream wrapper script for Gradle, supporting both the `JAVA_HOME` and `GRADLE_OPTS` environment variables.

- the `autossh-ng` NixOS module was introduced as a simpler alternative to the existing `autossh` module.
+1 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ pkgs.lib.recurseIntoAttrs rec {
  # check that bringing in one plugin with lua deps makes those deps visible from wrapper
  # for instance luasnip has a dependency on jsregexp
  can_require_transitive_deps = runTest nvim-with-luasnip ''
    ${nvim-with-luasnip}/bin/nvim -i NONE --cmd "lua require'jsregexp'" -e +quitall!
    ${nvim-with-luasnip}/bin/nvim -i NONE -c "lua require'jsregexp'" -e +quitall!
  '';

  inherit nvim_with_rocks_nvim;
+5 −12
Original line number Diff line number Diff line
@@ -107,9 +107,11 @@ let
        packpathDirs.myNeovimPackages = vimPackageInfo.vimPackage;
        finalPackdir = neovimUtils.packDir packpathDirs;

        luaDeps = extraLuaPackages lua.pkgs ++ vimPackageInfo.luaDependencies;

        luaPathLuaRc =
          let
            luaEnv = lua.withPackages (lp: extraLuaPackages lp ++ vimPackageInfo.luaDependencies);
            luaEnv = lua.withPackages (_: luaDeps);

            # getLuaPath / getLuaCPath are not interpreter dependant at the moment and might thus cause
            # errors between luajit/Puc lua
@@ -122,7 +124,7 @@ let
          '';

        rcContent = lib.concatStringsSep "\n" (
          lib.optional (extraLuaPackages lua.pkgs != [ ]) luaPathLuaRc
          lib.optional (luaDeps != [ ]) luaPathLuaRc
          ++ [ providerLuaRc ]
          ++ lib.optional (luaRcContent != "") luaRcContent
          ++ lib.optional (neovimRcContent' != "") ''
@@ -327,16 +329,7 @@ let
            rm $out/bin/nvim
            touch $out/rplugin.vim

            echo "Looking for lua dependencies..."
            source ${lua}/nix-support/utils.sh

            _addToLuaPath "${finalPackdir}"

            echo "LUA_PATH towards the end of packdir: $LUA_PATH"

            makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} ${wrapperArgsStr} \
                --prefix LUA_PATH ';' "$LUA_PATH" \
                --prefix LUA_CPATH ';' "$LUA_CPATH"
            makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} ${wrapperArgsStr}
          '';

        buildPhase = ''