Adding new neovim to nixpkgs

Hi All,

I was trying to follow this guide to add a Neovim plugin (yanky.nvim) to nixpkgs.

However, I found at first I couldn’t get ./update.py to work when I was running it:

pwd
# nixpkgs/pkgs/applications/editors/vim/plugins

❯ ./update.py
Traceback (most recent call last):
  File "/home/haseebmajid/projects/nixpkgs/pkgs/applica

I then went back to a previous commit when I knew the script worked, and I was able to run the update script (pkgs/applications/editors/vim/plugins/vim-plugin-names is updated)

./update.py add "gbprod/yanky.nvim"
path is '/nix/store/ylp17569db01vsgdmbykaldrrm82piia-c1211c6c6d983a72c74dde44df8575a64d50562f.tar.gz'
committing to nixpkgs "vimPlugins.yanky-nvim: init at 2023-10-17"

Then I try to run the command to update the generated.nix file but I get the following error

nix-shell -p vimPluginsUpdater --run vim-plugins-updater
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'shell'
         whose name attribute is located at /nix/store/whhzjfgalghpm34irclh01c0afynmyll-nixpkgs/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:300:7

       … while evaluating attribute 'buildInputs' of derivation 'shell'

         at /nix/store/whhzjfgalghpm34irclh01c0afynmyll-nixpkgs/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:347:7:

          346|       depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
          347|       buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
             |       ^
          348|       depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

       error: undefined variable 'vimPluginsUpdater'

       at «string»:1:107:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (vimPluginsUpdater) ]; } ""

Any ideas what I am doing wrong? Thanks!

My Branch: Comparing NixOS:master...hmajid2301:add-yanky · NixOS/nixpkgs · GitHub

Hello there (better late than never),

this is the way i do it

  1. Update the vim-plugin-names file
  2. Install the vim-plugins-updater via
    nix-shell -I nixpkgs=channel:nixpkgs-unstable -p vimPluginsUpdater
    
  3. Run the following inside the repository root:
    vim-plugins-updater
    

Note: This will also create a commit for you

If it complains about HTTP Error 429: Too Many Requests, ..., you’ll have to create a github token

and run

export GITHUB_API_TOKEN=your_token

before running the vim-plugins-updater command

1 Like

Cheers, that has done it.