Closed antotocar34 closed 1 year ago
Yes I definitely agree that you should be able to pass in your own plugins and have them be built for you. I don't think it will be possible to pass them in as a string due to the way the evaluation works. I am thinking of adding a third type, an attrset, to the plugin options: {name= pname; source = package}
. If it detects this then the plug-in is built. Could provide a library function for generating the attrset from an input.
Does that look good?
Edit: never mind I think I have an idea how this might work.
@antotocar34 I created a branch extra-inputs
. Feel free to switch to that and let me know if it works. Should achieve exactly what your example has. I haven't had the chance to test it yet so it might fail.
I tried it there. I think you forgot to add extraInputs
as an argument to neovimConfiguration
in the flake.nix
. After adding that though the "leap" was still not in the type enum, and calling lib.trace
on extraPluginNames
in types-plugin.nix
returns an empty list. Looked for a bit but didn't see why that was happening. I'm probably missing something obvious though, it's late :)
Ok I fixed it, I'll make a PR to the branch
See #19
I have some code cleanup I need to do and then I'll merge the branch into master.
I have finished a way to do this in #30 that works within the module system.. There is a new option rawPlugin
with a lib function to easily generate the attribute set from the inputs and a list of available plugins. Documentation forthcoming.
Hey love the work you've done with this. I really like the idea of a
home-manager
but for neovim :DIt would be great if in a user's custom
flake.nix
there could anextraInputs
argument:where
leap.nix
isand for that to just work.
I tried adding this
extraInputs
argument inneovim-flake
'sflake.nix
but then the module system complains that startPlugins can't accept"leap"
and wants a derivation instead.It would be nice if the user didn't have to package all the inputs they add themselves in that situation.