home-manager
home-manager copied to clipboard
pass a runtime attrset along with vim plugins
I've got a pretty fluid neovim setup, e.g, I often add/remove/disable neovim plugins. I sometimes achieve this imperatively via vim-plug/packer and sometimes via nix. One advantage of nix is that disabling removes the cruft.
Right now we can install plugins with an associated config, e.g.:
programs.neovim.plugins = {
plugin = gitsigns-nvim;
config = ''" hello world'';
}
Having everything written to a single init.vim prevents from using vim mechanisms that can make the config clearer (subjectively), for instance I prefer to add files in the "after" folder rather than using autocommands
programs.neovim.plugins = {
plugin = gitsigns-nvim;
config = ''" hello world'';
runtime = {
# implemented with a linFarm
"after/git/signs.vim".text = ''ventrecloque'';
}