Some checks failed
Publish every Git push to main to FlakeHub / flakehub-publish (push) Has been cancelled
Publish every git push to Flakestry / publish-flake (push) Has been cancelled
Documentation / Version info (push) Has been cancelled
Documentation / Build (push) Has been cancelled
Documentation / Combine builds (push) Has been cancelled
Documentation / Deploy (push) Has been cancelled
With the newer nixpkgs Neovim wrapper, plugin Lua dependencies are surfaced through neovimUtils.makeVimPackageInfo as vimPackageInfo.luaDependencies. Nixvim was still only feeding explicit extraLuaPackages into its wrapper Lua environment, so plugin-provided Lua modules stopped reaching the runtime search path after the flake.lock bump. That showed up as real runtime failures: Telescope could not load plenary.strings and Neorg could not load lua-utils, even though explicit extraLuaPackages still worked. Fix that by computing vimPackageInfo from config.build.plugins and appending vimPackageInfo.luaDependencies to the wrapper's extraLuaPackages. That keeps Nixvim aligned with the nixpkgs/Home Manager dependency resolution path instead of maintaining a separate recursive Lua dependency collector. Add focused regression coverage for the two reported plugin cases: - telescope -> plenary.strings - neorg -> lua-utils
69 lines
2.1 KiB
Nix
69 lines
2.1 KiB
Nix
let
|
|
mkLuaPathAssertions = moduleName: ''
|
|
local function split_semicolon_list(value)
|
|
local result = {}
|
|
for entry in string.gmatch(value or "", "[^;]+") do
|
|
table.insert(result, entry)
|
|
end
|
|
return result
|
|
end
|
|
|
|
local function resolve_module(module_name, search_path)
|
|
local module_path = module_name:gsub("%.", "/")
|
|
for _, entry in ipairs(split_semicolon_list(search_path)) do
|
|
local candidate = entry:gsub("%?", module_path)
|
|
if vim.uv.fs_stat(candidate) then
|
|
return candidate
|
|
end
|
|
end
|
|
end
|
|
|
|
local function assert_env_path_visible(env_name, runtime_value)
|
|
local env_value = vim.env[env_name]
|
|
assert(type(env_value) == "string", env_name .. " is unset")
|
|
|
|
local entries = split_semicolon_list(env_value)
|
|
assert(#entries > 0, env_name .. " has no non-empty entries")
|
|
|
|
for _, entry in ipairs(entries) do
|
|
assert(
|
|
runtime_value:find(entry, 1, true),
|
|
string.format(
|
|
"expected %s entry %q to be visible in runtime search path",
|
|
env_name,
|
|
entry
|
|
)
|
|
)
|
|
end
|
|
end
|
|
|
|
assert_env_path_visible("LUA_PATH", package.path)
|
|
assert_env_path_visible("LUA_CPATH", package.cpath)
|
|
assert(
|
|
resolve_module(${builtins.toJSON moduleName}, vim.env.LUA_PATH),
|
|
string.format("Unable to resolve %q via LUA_PATH", ${builtins.toJSON moduleName})
|
|
)
|
|
assert(
|
|
resolve_module(${builtins.toJSON moduleName}, package.path),
|
|
string.format("Unable to resolve %q via package.path", ${builtins.toJSON moduleName})
|
|
)
|
|
'';
|
|
in
|
|
{
|
|
telescope = {
|
|
plugins.web-devicons.enable = true;
|
|
plugins.telescope.enable = true;
|
|
|
|
extraConfigLuaPost = mkLuaPathAssertions "plenary.strings" + ''
|
|
local strings = require("plenary.strings")
|
|
assert(type(strings.truncate) == "function", "plenary.strings.truncate is unavailable")
|
|
'';
|
|
};
|
|
|
|
neorg = {
|
|
plugins.treesitter.enable = true;
|
|
plugins.neorg.enable = true;
|
|
|
|
extraConfigLuaPost = mkLuaPathAssertions "lua-utils" + ''require("lua-utils")'';
|
|
};
|
|
}
|