nix-community / nixvim

Configure Neovim with Nix! [maintainer=@GaetanLepage, @traxys, @mattsturgeon]
https://nix-community.github.io/nixvim
MIT License
1.39k stars 210 forks source link

[utils] `importLua` function and `luaToNix` script #1715

Open MattSturgeon opened 2 weeks ago

MattSturgeon commented 2 weeks ago

It'd be useful when adding/updating plugin modules to be able to paste some lua code into a script and get out valid nix. Effectively the opposite of helpers.toLuaObject.

This may also be useful within nixvim modules, either internally or for users.

It'd be nice to have a pure-nix function to do the heavy lifting, and then expose this through a script or something for use on the CLI. This would also apply to toLuaObject.

MattSturgeon commented 2 weeks ago

Actually, I'm tempted to move toLuaObject out of tree into a dedicated nix/lua tools flake.