make lua package loading conditional on cat

This commit is contained in:
Daniel Winkler 2026-05-21 21:10:30 +10:00
commit 6226a1c9b1

View file

@ -1,6 +1,7 @@
local add = Config.add local add = Config.add
local now_if_args = Config.now_if_args local now_if_args = Config.now_if_args
local later = MiniDeps.later local later = MiniDeps.later
local nix = require('config.nix')
if not Config.isNixCats then if not Config.isNixCats then
local m_add = MiniDeps.add local m_add = MiniDeps.add
@ -12,19 +13,21 @@ end
-- lua -- lua
later(function() later(function()
add("luvit-meta") if nix.get_cat("lua", false) then
add("lazydev") add("luvit-meta")
require("lazydev").setup({ add("lazydev")
library = { require("lazydev").setup({
-- See the configuration section for more details library = {
-- Load luvit types when the `vim.uv` word is found -- See the configuration section for more details
"lua", -- Load luvit types when the `vim.uv` word is found
"mini.nvim", "lua",
"MiniDeps", "mini.nvim",
{ path = "luvit-meta/library", words = { "vim%.uv" } }, "MiniDeps",
{ path = "${3rd}/luv/library", words = { "vim%.uv" } }, { path = "luvit-meta/library", words = { "vim%.uv" } },
}, { path = "${3rd}/luv/library", words = { "vim%.uv" } },
}) },
})
end
end) end)
-- Markdown -- Markdown