diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index 831695a..bb0e2fa 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -41,11 +41,12 @@ M.defaults = { -- the first package source that is found for a plugin will be used. sources = { "lazy", - "rockspec", + "rockspec", -- will only be used when rocks.enabled is true "packspec", }, }, rocks = { + enabled = true, root = vim.fn.stdpath("data") .. "/lazy-rocks", server = "https://nvim-neorocks.github.io/rocks-binaries/", }, diff --git a/lua/lazy/pkg/init.lua b/lua/lazy/pkg/init.lua index 2d5b7d9..ee0daa4 100644 --- a/lua/lazy/pkg/init.lua +++ b/lua/lazy/pkg/init.lua @@ -32,10 +32,12 @@ function M.update() ---@type LazyPkgSource[] local sources = {} for _, s in ipairs(Config.options.pkg.sources) do - sources[#sources + 1] = { - name = s, - get = require("lazy.pkg." .. s).get, - } + if s ~= "rockspec" or Config.options.rocks.enabled then + sources[#sources + 1] = { + name = s, + get = require("lazy.pkg." .. s).get, + } + end end ---@type LazyPkgCache