neovim: restore provider configuration in legacy mode

We used to unconditionnally wrap the provider configuration.
https://github.com/NixOS/nixpkgs/pull/487390 "smartly" embeds it into
init.lua depending on `wrapRc` but that breaks neovim legacy behavior in some cases since `legacyWrapper` sets `wrapRc` to false in absence of some of user configuration.
One day we will get rid of the legacy wrapper but until then keep that behavior.

Most of the changes come from linter.
This commit is contained in:
teto 2026-02-19 17:10:44 +01:00
commit 4d7ec078bd
3 changed files with 22 additions and 13 deletions

View file

@ -242,7 +242,7 @@
- `openrgb` was updated to 1.0rc2, which now uses Plugin API version 4.
Some existing OpenRGB plugins may be incompatible or require updates.
- the `neovim` wrapper sets provider-related configuration in its generated config rather than as wrapper arguments. It should not affect configuration unless you set `wrapRc` to false.
- `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`.
- We now use the upstream wrapper script for Gradle, supporting both the `JAVA_HOME` and `GRADLE_OPTS` environment variables.

View file

@ -223,7 +223,8 @@ let
res
// {
wrapperArgs = lib.escapeShellArgs res.wrapperArgs + " " + extraMakeWrapperArgs;
wrapRc = (configure != { });
wrapRc = configure != { };
legacyWrapper = true;
}
);

View file

@ -130,17 +130,25 @@ let
wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs;
generatedWrapperArgs =
lib.optionals
(
finalAttrs.packpathDirs.myNeovimPackages.start != [ ]
|| finalAttrs.packpathDirs.myNeovimPackages.opt != [ ]
)
[
"--add-flags"
''--cmd "set packpath^=${finalPackdir}"''
"--add-flags"
''--cmd "set rtp^=${finalPackdir}"''
]
# neovimUtils.legacyWrapper adds a `legacyWrapper` attribute to let us know we run in "legacy" mode
lib.optionals (attrs ? legacyWrapper) [
# vim accepts a limited number of commands so we join all the provider ones
"--add-flags"
''--cmd "lua ${providerLuaRc}"''
]
++
lib.optionals
(
finalAttrs.packpathDirs.myNeovimPackages.start != [ ]
|| finalAttrs.packpathDirs.myNeovimPackages.opt != [ ]
)
[
"--add-flags"
''--cmd "set packpath^=${finalPackdir}"''
"--add-flags"
''--cmd "set rtp^=${finalPackdir}"''
]
++ lib.optionals finalAttrs.withRuby [
"--set"
"GEM_HOME"