LuaRocks, and the second copy of it your Neovim plugin manager may have installed
LuaRocks installs rocks into ~/.luarocks or a system tree, and some Neovim plugin managers build their own. How to find every tree on a Mac and what to remove.
Rocks themselves are small. What surprises people is how many trees there are: the user tree in ~/.luarocks, a system tree under Homebrew, and, if you use a Neovim plugin manager with rocks support, a separate Lua and LuaRocks it built just for itself.
luarocks config local_cache # where downloaded rockspecs are cached
du -sh ~/.luarocks ~/.cache/luarocks 2>/dev/null
du -sh ~/.local/share/nvim/lazy-rocks ~/.local/share/nvim/rocks 2>/dev/null
luarocks list --localRemove what you do not use
luarocks remove --local <rock>
# Remove every rock in the user tree at once
luarocks purge --tree=$HOME/.luarockspurge empties the whole tree, so only run it when nothing you use loads rocks from there. The download cache is safe to delete at any time.
Neovim's own rocks
Plugin managers that support rocks can build a private Lua and LuaRocks the first time a plugin asks for one. Those folders belong to the plugin manager, so remove them through it, or delete them and let it rebuild on the next start. See Neovim plugins and Mason for the rest of Neovim's data folder, and hidden dot folders for the others in your home.
Common questions
Where does LuaRocks install rocks on a Mac?
With --local, in ~/.luarocks. Without it, in the system tree of the Lua it was installed with, which for Homebrew is under the Homebrew prefix. luarocks list shows the trees and what is in each.
How do I remove all LuaRocks packages?
luarocks purge --tree= followed by the tree path removes every rock in that tree. Use it only on a tree nothing you use depends on, and use luarocks remove for single rocks.
Why does Neovim have its own LuaRocks?
Some plugin managers build a private Lua and LuaRocks so plugins that need rocks work without a system install. It lives in Neovim's data folder and the plugin manager can rebuild it.