From 0f4517f2eab27b7b90c54a6cb0a52ff70868e8b2 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Thu, 19 Feb 2026 17:54:49 +0100 Subject: [PATCH] Revert "neovim: set provider configuration to initrc" --- doc/release-notes/rl-2605.section.md | 2 - pkgs/applications/editors/neovim/wrapper.nix | 48 ++++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/doc/release-notes/rl-2605.section.md b/doc/release-notes/rl-2605.section.md index 10802b054ec7..2bbb2d565864 100644 --- a/doc/release-notes/rl-2605.section.md +++ b/doc/release-notes/rl-2605.section.md @@ -187,8 +187,6 @@ - `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. - - We now use the upstream wrapper script for Gradle, supporting both the `JAVA_HOME` and `GRADLE_OPTS` environment variables. ## Nixpkgs Library {#sec-nixpkgs-release-26.05-lib} diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index 6c97a6f22377..e8f04ad30fc3 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -104,16 +104,13 @@ let packpathDirs.myNeovimPackages = vimPackageInfo.vimPackage; finalPackdir = neovimUtils.packDir packpathDirs; - rcContent = lib.concatStringsSep "\n" ( - [ - providerLuaRc - ] - ++ lib.optional (luaRcContent != "") luaRcContent - ++ lib.optional (neovimRcContent' != "") '' - vim.cmd.source "${writeText "init.vim" neovimRcContent'}" - '' - ++ lib.optionals autoconfigure vimPackageInfo.pluginAdvisedLua - ); + rcContent = '' + ${luaRcContent} + '' + + lib.optionalString (neovimRcContent' != "") '' + vim.cmd.source "${writeText "init.vim" neovimRcContent'}" + '' + + lib.optionalString autoconfigure (lib.concatStringsSep "\n" vimPackageInfo.pluginAdvisedLua); python3Env = lib.warnIf (attrs ? python3Env) @@ -128,7 +125,12 @@ let wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs; - generatedWrapperArgs = + generatedWrapperArgs = [ + # 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 != [ ] @@ -140,17 +142,17 @@ let "--add-flags" ''--cmd "set rtp^=${finalPackdir}"'' ] - ++ lib.optionals finalAttrs.withRuby [ - "--set" - "GEM_HOME" - "${rubyEnv}/${rubyEnv.ruby.gemPath}" - ] - ++ lib.optionals (finalAttrs.runtimeDeps != [ ]) [ - "--suffix" - "PATH" - ":" - (lib.makeBinPath finalAttrs.runtimeDeps) - ]; + ++ lib.optionals finalAttrs.withRuby [ + "--set" + "GEM_HOME" + "${rubyEnv}/${rubyEnv.ruby.gemPath}" + ] + ++ lib.optionals (finalAttrs.runtimeDeps != [ ]) [ + "--suffix" + "PATH" + ":" + (lib.makeBinPath finalAttrs.runtimeDeps) + ]; providerLuaRc = neovimUtils.generateProviderRc { inherit (finalAttrs) @@ -179,7 +181,7 @@ let ++ lib.optionals finalAttrs.wrapRc [ "--set-default" "VIMINIT" - "lua dofile('${writeText "init.lua" finalAttrs.luaRcContent}')" + "lua dofile('${writeText "init.lua" rcContent}')" ] ++ finalAttrs.generatedWrapperArgs;