Proper way to install neovim plugins without home-manager

I’m trying to install my neovim plugins via packer.nvim without using the home-manager neovim module.

To do this I have the following in my home.nix:

  ...
  home.file = {
    "${config.xdg.configHome}/nvim" = {
      source = ../../defaults/nvim;
      recursive = true;
    };
  };
  ...

where ../../defaults/nvim is just the path to my neovim config, which can be found here.

Unfortunately, if I try to :PackerInstall after home-manager switching, neovim segfaults. I’ve already opened an issue here on the packer.nvim github page.

If I’m not mistaken the home-manager neovim module uses packer under the hood to install all the plugins, so using packer on NixOS should definitely be possible.

Does anyone have some idea on what could be going on?

1 Like

Is there a particular reason to use home.file instead of just xdg.configFile?

I use vim-plug with:

xdg.configFile."nvim" = {
  source = ../dotfiles/.config/nvim;
  recursive = true;
};

and that works fine for me.

Is there a particular reason to use home.file instead of just xdg.configFile ?

Nope, I just didn’t know that was an option. It works fine for me too now.