mirror of https://github.com/folke/lazy.nvim.git
feat: make it easier to disable luarocks
This commit is contained in:
parent
105d4805ad
commit
07c067a1a8
|
@ -41,11 +41,12 @@ M.defaults = {
|
||||||
-- the first package source that is found for a plugin will be used.
|
-- the first package source that is found for a plugin will be used.
|
||||||
sources = {
|
sources = {
|
||||||
"lazy",
|
"lazy",
|
||||||
"rockspec",
|
"rockspec", -- will only be used when rocks.enabled is true
|
||||||
"packspec",
|
"packspec",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
rocks = {
|
rocks = {
|
||||||
|
enabled = true,
|
||||||
root = vim.fn.stdpath("data") .. "/lazy-rocks",
|
root = vim.fn.stdpath("data") .. "/lazy-rocks",
|
||||||
server = "https://nvim-neorocks.github.io/rocks-binaries/",
|
server = "https://nvim-neorocks.github.io/rocks-binaries/",
|
||||||
},
|
},
|
||||||
|
|
|
@ -32,11 +32,13 @@ function M.update()
|
||||||
---@type LazyPkgSource[]
|
---@type LazyPkgSource[]
|
||||||
local sources = {}
|
local sources = {}
|
||||||
for _, s in ipairs(Config.options.pkg.sources) do
|
for _, s in ipairs(Config.options.pkg.sources) do
|
||||||
|
if s ~= "rockspec" or Config.options.rocks.enabled then
|
||||||
sources[#sources + 1] = {
|
sources[#sources + 1] = {
|
||||||
name = s,
|
name = s,
|
||||||
get = require("lazy.pkg." .. s).get,
|
get = require("lazy.pkg." .. s).get,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---@type LazyPkgCache
|
---@type LazyPkgCache
|
||||||
local ret = {
|
local ret = {
|
||||||
|
|
Loading…
Reference in New Issue