Skip to content
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

[New module] lazy.nvim #797

Closed
pta2002 opened this issue Dec 9, 2023 · 6 comments
Closed

[New module] lazy.nvim #797

pta2002 opened this issue Dec 9, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@pta2002
Copy link
Collaborator

pta2002 commented Dec 9, 2023

Plugin: lazy.nvim
Plugin repository: https://github.com/folke/lazy.nvim
Is the plugin on nixpkgs: Yes

Extra information

Following the discussions around #421, one thing has become clear: lazy.nvim already implements pretty much everything we need.

Therefore, instead of reinventing the wheel, the best course of action starts with adding a module to allow for plugin management via lazy.nvim. This can later be implemented to load plugins from extraPlugins, but at first it can just be a separate option from the module, given that supporting that would require a flag to tell nixvim to not install plugins the other way.

Either way, this should follow the same general idea as the packer module. Since lazy.nvim supports loading plugins from a directory (via the dir option), we can sidestep its plugin downloading completely, too, keeping the config reproducible :) (Though we should still allow a user to have lazy.nvim download plugins, in order to let them easily install out-of-tree plugins. However, IMO everything officially supported by us should come from Nix, since it's not that much extra work to package).

Eventually™ we can fork out lazy.nvim's lazy-loading code to a separate library, and have a module for that, to make builds smaller. But as I said in the beginning, no need to reinvent the wheel for now! Let's just use what works and see how it goes.

@pta2002 pta2002 added the enhancement New feature or request label Dec 9, 2023
@ehsan2003
Copy link

I kinda guess that reinventing the wheel in this case is pretty much appropriate

@pta2002
Copy link
Collaborator Author

pta2002 commented Jan 30, 2024

@ehsan2003 there was a fairly long discussion about this in #421, and the general consensus was basically "lazy.nvim already does this and we can use it to try out the idea at first and then eventually roll our own", but obviously there's merits to doing this ourselves. If you have any insights feel free to leave them in the original feature issue

@ck3mp3r
Copy link
Contributor

ck3mp3r commented Feb 26, 2024

I've started experimenting with creating a plugin manager for lazy.nvim. I've taken the current packer.nix implementation as inspiration as I am not that familiar with the internals just yet.
Still a fair amount of work left (need to implement some more of the lazy.nvim basic properties), but this is a working version.
https://github.com/ck3mp3r/nixvim/pull/1/files
This does not address using lazy.nvim as a default package manager for nixvim, there would need to be a bit of re-architecting required to make that work, but at least this would be a stop gap solution for those needing lazy loading for some of their plugins.

Constructive criticism welcome!

@ck3mp3r
Copy link
Contributor

ck3mp3r commented Mar 1, 2024

I've added a PR for adding lazy.nvim as an alternative to packer. Still draft until some other folks give it a spin.
#1175
I've been using this to refactor my nixvim config to allow lazy package management, not allowing fetching outside of the nix package ecosystem however, kinda defeats the purpose...

Please feel free to give it a spin!

@ck3mp3r
Copy link
Contributor

ck3mp3r commented Mar 9, 2024

@pta2002 I guess we can close this now since the new plugin has landed...

@pta2002
Copy link
Collaborator Author

pta2002 commented Mar 9, 2024

You're right!

@pta2002 pta2002 closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants