Hello
I am not able to add any plugin to neovim using home manager. When I use regular programs.neovim
, it installs neovim correctly, but it does not create any init.lua file and plugins are not loaded:
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
plugins = with pkgs.vimPlugins; [
nvim-tree-lua
catppuccin-nvim
nvim-lspconfig
nvim-treesitter.withAllGrammars
plenary-nvim
gruvbox-material
mini-nvim
];
};
And when I use nixvim
, I get an error from a require(...)
call in init.lua, and I cannot load the plugins:
rror detected while processing /home/ganyuss/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /home/ganyuss/.config/nvim/init.lua:5: module 'lualine' not found:
no field package.preload['lualine']
no file '/nix/store/c5qdp465d4wfswhdngay2alhwxqkiczq-luajit-2.1.1713773202-env/share/lua/5.1/lualine.lua'
no file '/nix/store/c5qdp465d4wfswhdngay2alhwxqkiczq-luajit-2.1.1713773202-env/share/lua/5.1/lualine/init.lua'
no file '/nix/store/c5qdp465d4wfswhdngay2alhwxqkiczq-luajit-2.1.1713773202-env/lib/lua/5.1/lualine.so'
stack traceback:
[C]: in function 'require'
/home/ganyuss/.config/nvim/init.lua:5: in main chunk
Here is my nixvim config:
programs.nixvim = {
enable = true;
# plugins.catppuccin.enable = true;
# colorschemes.catppuccin.enable = true;
plugins.lualine.enable = true;
};
From what I have seen, it is probably because the paths to the plugins are not added in the runtimepath of neovim. But I have no idea why, nor where the huge list of paths in runtimepath comes from.
If you have any idea what I am doing wrong, that would be fantastic!