modules/output: drop deprecated makeNeovimConfig

nixpkgs deprecated neovimUtils.makeNeovimConfig in favor of
wrapNeovimUnstable. Keep Nixvim's current generated init.lua startup
model, but stop routing wrapper construction through the deprecated
helper.

Switch modules/top-level/output.nix to call wrapNeovimUnstable
directly and preserve the existing wrappedNeovim.initRc -> generated
init.lua composition. This aligns Nixvim with the upstream wrapper API
change without changing our current bootstrap behavior yet.

Also update CONTRIBUTING to point contributors at
wrapNeovimUnstable instead of the deprecated helper.
This commit is contained in:
Austin Horstman 2026-03-29 00:39:14 -05:00 committed by Gaétan Lepage
parent 2b9f8e1d65
commit f6f985ce53
2 changed files with 24 additions and 27 deletions

View file

@ -23,9 +23,8 @@ Either command will start a HTTP server on port 8000 and open it in your browser
## Nixvim Architecture
Nixvim is mainly built around `pkgs.neovimUtils.makeNeovimConfig`.
This function takes a list of plugins (and a few other misc options), and generates a configuration for Neovim.
This can then be passed to `pkgs.wrapNeovimUnstable` to generate a derivation that bundles the plugins, extra programs and the Lua configuration.
Nixvim is mainly built around `pkgs.wrapNeovimUnstable`.
This wrapper takes a list of plugins and related options, and generates a derivation that bundles the plugins, extra programs and the Lua configuration.
All the options that Nixvim exposes end up in those three places. This is done in the `modules/output.nix` file.

View file

@ -7,7 +7,7 @@
}:
let
inherit (lib) types mkOption mkPackageOption;
inherit (lib) optional optionalAttrs;
inherit (lib) optional;
builders = lib.nixvim.builders.withPkgs pkgs;
inherit (pkgs.stdenv.hostPlatform) system;
in
@ -199,8 +199,10 @@ in
else
config.extraLuaPackages;
neovimConfig = pkgs.neovimUtils.makeNeovimConfig (
{
luaEnv = package.lua.withPackages extraLuaPackages;
wrappedNeovim =
(pkgs.wrapNeovimUnstable package {
inherit extraLuaPackages;
inherit (config)
extraPython3Packages
@ -212,29 +214,25 @@ in
withPerl
withPython3
;
# inherit customRC;
inherit (config.build) plugins;
}
# Necessary to make sure the runtime path is set properly in NixOS 22.05,
# or more generally before the commit:
# cda1f8ae468 - neovim: pass packpath via the wrapper
// optionalAttrs (lib.functionArgs pkgs.neovimUtils.makeNeovimConfig ? configure) {
configure.packages = {
nixvim = {
start = map (x: x.plugin) config.build.plugins;
opt = [ ];
};
wrapperArgs = lib.optionals (luaEnv != null) [
"--prefix"
"LUA_PATH"
";"
(package.lua.pkgs.luaLib.genLuaPathAbsStr luaEnv)
"--prefix"
"LUA_CPATH"
";"
(package.lua.pkgs.luaLib.genLuaCPathAbsStr luaEnv)
];
}).overrideAttrs
{
# TODO: 2025-01-06
# Wait for user feedback on disabling the fixup phase.
# Ideally this will be upstreamed to nixpkgs.
# See https://github.com/nix-community/nixvim/pull/3660#discussion_r2326250439
dontFixup = true;
};
}
);
# TODO: 2025-01-06
# Wait for user feedback on disabling the fixup phase.
# Ideally this will be upstreamed to nixpkgs.
# See https://github.com/nix-community/nixvim/pull/3660#discussion_r2326250439
wrappedNeovim = (pkgs.wrapNeovimUnstable package neovimConfig).overrideAttrs {
dontFixup = true;
};
customRC = lib.nixvim.concatNonEmptyLines [
(lib.nixvim.wrapVimscriptForLua wrappedNeovim.initRc)