How do I get nvim-cmp working in neovim

I try to use nvim-cmp with neovim from the neovim-flake.

This is the error while building:

Generating remote plugin manifest
Error detected while processing /nix/store/is6497iayyxy1fpviwb8x221xp7645bf-lua5.1-nvim-cmp-0.0.1-2/nvim-cmp-0.0.1-2-rocks/nvim-cmp/0.>
E5113: Error while calling lua chunk: ...2/nvim-cmp-0.0.1-2-rocks/nvim-cmp/0.0.1-2/plugin/cmp.lua:10: module 'cmp.utils.api' not found:
        no field package.preload['cmp.utils.api']
        no file '/nix/store/5myx7s4iqsj08pqci4r2d6b1rdm093vg-luajit-2.1.0-2022-04-05-env/share/lua/5.1/cmp/utils/api.lua'
        no file '/nix/store/5myx7s4iqsj08pqci4r2d6b1rdm093vg-luajit-2.1.0-2022-04-05-env/share/lua/5.1/cmp/utils/api/init.lua'
        no file '/nix/store/5myx7s4iqsj08pqci4r2d6b1rdm093vg-luajit-2.1.0-2022-04-05-env/lib/lua/5.1/cmp/utils/'
        no file '/nix/store/5myx7s4iqsj08pqci4r2d6b1rdm093vg-luajit-2.1.0-2022-04-05-env/lib/lua/5.1/'
stack traceback:
        [C]: in function 'require'
        ...2/nvim-cmp-0.0.1-2-rocks/nvim-cmp/0.0.1-2/plugin/cmp.lua:10: in main chunk
remote/host: python3 host registered plugins []
remote/host: generated rplugin manifest: /nix/store/hbvrmm71jsdfzlm3m0y3zw81xs3srdd9-neovim-master/rplugin.vim
Generating rplugin.vim failed!


All I could find so far is this ticket but /nix/store/is6497iayyxy1fpviwb8x221xp7645bf-lua5.1-nvim-cmp-0.0.1-2/nvim-cmp-0.0.1-2-rocks/nvim-cmp/0.0.1-2/plugin/cmp.lua doesn’t seem to have any of these lines mentioned there in it.

Am I doing something obviously wrong ?

Following i. e. vimPlugins: make usage of luaPackages less confusing by teto · Pull Request #195732 · NixOS/nixpkgs · GitHub with my (linked in OP) flake loaded I started a repl and

nix-repl> :b inputs.neovim-flake.inputs.nixpkgs.legacyPackages.aarch64-linux.vimPlugins.nvim-cmp

This derivation produced the following outputs:
  out -> /nix/store/fwn3zw8ca8iq4ppi14h4gim1003pksdz-lua5.1-nvim-cmp-0.0.1-2

was able to build :confused:

I am able to run nvim-cmp from nix with no issue but maybe on master it needs the PR you linked (hoping to merge later today).

1 Like

Thanks for reaching out @teto !

I’m on github:NixOS/nixpkgs/nixpkgs-unstable and rn I’m trying without using the overlay just as the person in nix-rebuild switch fails with newest (9f85389) master · Issue #153 · nix-community/neovim-nightly-overlay · GitHub writes.

If that ain’t working I’m trying the PR.