Skip to content

Commit 07c067a

Browse files
committed
feat: make it easier to disable luarocks
1 parent 105d480 commit 07c067a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lua/lazy/core/config.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ M.defaults = {
4141
-- the first package source that is found for a plugin will be used.
4242
sources = {
4343
"lazy",
44-
"rockspec",
44+
"rockspec", -- will only be used when rocks.enabled is true
4545
"packspec",
4646
},
4747
},
4848
rocks = {
49+
enabled = true,
4950
root = vim.fn.stdpath("data") .. "/lazy-rocks",
5051
server = "https://nvim-neorocks.github.io/rocks-binaries/",
5152
},

lua/lazy/pkg/init.lua

+6-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ function M.update()
3232
---@type LazyPkgSource[]
3333
local sources = {}
3434
for _, s in ipairs(Config.options.pkg.sources) do
35-
sources[#sources + 1] = {
36-
name = s,
37-
get = require("lazy.pkg." .. s).get,
38-
}
35+
if s ~= "rockspec" or Config.options.rocks.enabled then
36+
sources[#sources + 1] = {
37+
name = s,
38+
get = require("lazy.pkg." .. s).get,
39+
}
40+
end
3941
end
4042

4143
---@type LazyPkgCache

0 commit comments

Comments
 (0)