Goal
Make the nixd LSP resolve symbols from nixpkgs so hover and go-to-definition work on pkgs.* references (e.g. hovering pkgs.ripgrep or jumping into a package definition).
Background
pkgs/neovim-wrapped/plugins/lspconfig/config.lua configures nixd with settings.nixd.options (nixos/darwin option sets) but no settings.nixd.nixpkgs.expr. Per nixd's configuration, nixpkgs.expr provides the package set nixd evaluates for completion/hover/definition on pkgs.*; without it nixd has no nixpkgs data. (nixd docs: docs/configuration.md, key nixpkgs.expr, default import <nixpkgs> { }.)
Plan
- Add a
nixpkgs block alongside the existing options block in the nixd settings:
nixpkgs = {
expr = "import (builtins.getFlake (builtins.toString ./.)).inputs.nixpkgs { }",
},
This reuses the flake's own nixpkgs input rather than a <nixpkgs> channel lookup, consistent with the existing options.*.expr values and with the repo's flake-native Nix style (no <nixpkgs>).
Verification
nix build .#neovim-wrapped succeeds.
- Lua config remains syntactically valid (loads in headless nvim without error).
- Manual: in a nix file, hover over a
pkgs.<name> reference resolves (noted as a manual step; headless LSP hover is hard to assert in CI).
From the linux todo list: "Make is so that nixd can find stuff from the store, for example on hover or go to definition".
Goal
Make the
nixdLSP resolve symbols from nixpkgs so hover and go-to-definition work onpkgs.*references (e.g. hoveringpkgs.ripgrepor jumping into a package definition).Background
pkgs/neovim-wrapped/plugins/lspconfig/config.luaconfigures nixd withsettings.nixd.options(nixos/darwin option sets) but nosettings.nixd.nixpkgs.expr. Per nixd's configuration,nixpkgs.exprprovides the package set nixd evaluates for completion/hover/definition onpkgs.*; without it nixd has no nixpkgs data. (nixd docs:docs/configuration.md, keynixpkgs.expr, defaultimport <nixpkgs> { }.)Plan
nixpkgsblock alongside the existingoptionsblock in thenixdsettings:<nixpkgs>channel lookup, consistent with the existingoptions.*.exprvalues and with the repo's flake-native Nix style (no<nixpkgs>).Verification
nix build .#neovim-wrappedsucceeds.pkgs.<name>reference resolves (noted as a manual step; headless LSP hover is hard to assert in CI).From the linux todo list: "Make is so that nixd can find stuff from the store, for example on hover or go to definition".