Neovim no longer uses config or plugins

Hi NixOS community, yesterday I decided to upgrade my system to the unstable version. In the previous version 20.09 I had created a configuration for neovim using this guide Vim - NixOS Wiki
However now it no longer uses my configuration. I have tried looking at the package on github, but don’t really understand it other than it seems that I am using a legacy version of the configuration. Can someone help? :slight_smile:

Can you post your current config?

Same issue here:

Using unstable: github:nixos/nixpkgs/540dccb2aeaffa9dc69bfdc41c55abd7ccc6baa3

  programs.neovim = {
    enable = true;
    defaultEditor = true;
    viAlias = true;
    vimAlias = true;
    configure = {
      customRC = ''
        set undofile
        set undodir=~/.vim/undodir
      '';
      packages.nix.start = with pkgs.vimPlugins; [ vim-nix coc-nvim ];
    };
  };

So this worked before

  environment.systemPackages = with pkgs; [
    (neovim.override {
      vimAlias = true;
      configure = {
        customRC = builtins.readFile ./config/init.vim;
        packages.myPlugins = with pkgs.vimPlugins; {
        start = [
          vim-surround # Shortcuts for setting () {} etc.
          coc-nvim coc-git coc-highlight coc-python coc-rls coc-vetur coc-vimtex coc-yaml coc-html coc-json # auto completion
          vim-nix # nix highlight
          vimtex # latex stuff
          fzf-vim # fuzzy finder through vim
          nerdtree # file structure inside nvim
          rainbow # Color parenthesis
        ];
        opt = [];
        };
      };
    })
  ];

I have tried @shimun s suggestion, but that did not work either

  programs.neovim = {
    enable = true;
    defaultEditor = true;
    viAlias = true;
    vimAlias = true;
    configure = {
      customRC = builtins.readFile ./config/init.vim;
      packages.nix = with pkgs.vimPlugins; {
        start = [
          vim-surround # Shortcuts for setting () {} etc.
          coc-nvim coc-git coc-highlight coc-python coc-rls coc-vetur coc-vimtex coc-yaml coc-html coc-json # auto completion
          vim-nix # nix highlight
          vimtex # latex stuff
          fzf-vim # fuzzy finder through vim
          nerdtree # file structure inside nvim
          rainbow # Color parenthesis
        ];
        opt = [];
      };
    };
  };

Might be related Can't override unstable.neovim anymore

2 Likes

Looks like a fix has already been merged: https://github.com/NixOS/nixpkgs/pull/124785

To get it now you should be able to put that in an override for neovim.

1 Like

Hmmm, it still does not seem to work after nix-rebuild switch --update.

I have tried both with the programs.neovim and neovim.override.

It’s not in unstable yet Nixpkgs PR #124785 ("Fix neovim.override") progress

1 Like