Cmp-nixpkgs: two nvim-cmp completion sources for nixpkgs

Mostly a holdout until gets autocompletion support for attributes and nixos modules.

This is a simple wrapper around NIX_GET_COMPLETIONS=3 nix eval --read-only that currently makes some assumptions about how nix/nixos is configured, see the README and source code for more.

It’s split into two sources:

  • nixpkgs, for pkgs, lib, and config.
  • nixos, for nixos modules.

The sources have some support for nested attributes by leveraging tree-sitter to get the surrounding context for the node at cursor, however this can be somewhat fragile.


Hosted by Flying Circus.