Ever installed plugins using mason and thought "hmm. I wish I could just use my system package manager for this too" Well say no more my dear cause metapack.nvim is here!
metapack.nvim isn't a plugin manager. It's a meta plugin manager. It doesn't install the plugins directly. Instead, it first tries to use your system package manager, if it can, then it tries to install it from that. And if it doesn't, it tries to use mason as fallback
Using lazy.nvim:
{
"ingenarel/metapack.nvim",
dependencies = {
{
"williamboman/mason.nvim",
config = true,
},
},
config = function()
require("metapack").ensure_installed {
--lsp
"pyright", -- package could be string for simple use
"clangd",
{
name = "lua-language-server",
portage = true,
os = "gentoo"
}, -- or it could be a table specifying stuff,
{
name = "lua-language-server-git",
aur = true,
os = "arch",
execName = "lua-language-server"
}, -- you can use execName if the package name isn't the same as the executable name
"bash-language-server",
"termux-language-server",
"ltex-ls",
"yaml-language-server",
--lsp
--dap
{ name = "codelldb", mason = true}, -- if you use table, it's not idiotproof, so if you name a plugin wrong, that's on you.
"debugpy",
--dap
--formatter
"black",
"stylua",
"clang-format",
"beautysh",
--formatter
}
end,
}
Using doas
Metapack works with sudo when trying to interact with your package manager. But it can also use doas.
require("metapack").ensure_installed(
{
--packages
}
true
)
Implement these package managers:
- building from source
- cargo
- dnf
- luarocks
- npm
- pip
- scoop
- apt
- yay
- pacman
- paru
Implement these features
-
Specifying:
- version
- commit hash
-
operating system / Linux distro -
package manager
-
Features:
- A logger for managing, cleaning, deleting and updating packages.
- Work with gentoo USE flags some stuff in gentoo, like codelldb and clang-format, are not separate packages, but instead they are USE flags in the clang package