-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build plugin specs as derivations #6
Comments
Doing it this way would also allow for breaking up the plugin specs as is mentioned here; https://github.com/folke/lazy.nvim?tab=readme-ov-file#-structuring-your-plugins Might be nice. |
re: passthru.lazy-spec (or whatever) it would allow
you could do
https://github.com/willruggiano/neovim.drv/blob/main/plugins/spec.nix#L269-L274 |
another interesting approach would be more like dream2nix, so the "plugin spec" could import modules |
Does that mean turning the single LazySpec we build atm to a LazySpec[], generating a Lua file for each plugin, then importing them like vim.opt.rtp:prepend "${cfg.package}"
vim.opt.rtp:prepend "${cfg.plugins}" -- symlinkJoin of all plugins or similar
require("lazy").setup({
spec = {
{ import = "nvim-treesitter" }, -- loading the lua configs from the plugin rtp
{ import = "which-key" },
-- ... etc
},
}) I'd also like to have a way to add custom Lua specs in there, so that you could configure the plugin package via Nix, and then use Lua with the opts override pattern that's common in LazyVim, e.g: return {
{
name = "myplugin",
opts = function(_, opts)
opts.some_override = "foo"
end
}
} while defining the package/ |
re: generating a Lua file per plugin Yes, I think that's what I meant. |
re: custom Lua specs I think we should able to support basically anything if we're strategic about how we integrate with lazy. Specifically this part of the docs;
https://lazy.folke.io/usage/structuring#%EF%B8%8F-importing-specs-config--opts This seems like it maps really well into Nix - it reminds me a lot of flake-parts. I'll add some more comments here this week hopefully |
Right now, the entire lazy spec is defined "in a single derivation". Better - I think - would be to build each plugin individually (which we already do) and attach to it (e.g. via
passthru
) its lazy spec (as a derivation). This is more in line with how flake-parts is organized.The text was updated successfully, but these errors were encountered: