Vscode: nixd still completes old nixpkgs packages

I updated the nixpkgs input from 24.11 to unstable in flake.nix, then updated the flake.lock. Now when I nixos-rebuild, it tells me “nerdfonts” is now “nerd-fonts.”. However, in vscode with the Nix IDE plugin, and the following in User/settings.json:

  "nix.enableLanguageServer": true,
  "nix.serverPath": "nixd",

the autocompletion still finds “pkgs.nerdfonts” and no “pkgs.nerd-fonts”.

Do you know how nixd determines which nixpkgs it should use?

Same when I load nixpkgs with :l <nixpkgs> in the nix repl. I have a NIX_PATH of nixpkgs=flake:nixpkgs. Not sure how that resolves neither, it also works in folders without a flake.nix

It uses the nixpkgs entry of the global flake registry located at /etc/nix/registry.json.

1 Like

Thanks! That’s probably what nixd takes as well. At least after upgrading the system, the global flake’s registry’s nixpkgs points to unstable, and both nix repl and vscode find the new packages.