Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cachix/devenv/llms.txt
Use this file to discover all available pages before exploring further.
devenv ships a bundled nixd language server pre-configured for your devenv.nix. Running devenv lsp gives you autocomplete, hover documentation, and go-to-definition in any editor that supports the Language Server Protocol (LSP) — with zero manual nixd configuration required.
Starting the language server
The command assembles your devenv configuration, generates the appropriate nixd settings (nixpkgs expression and devenv options), and then replaces itself with the nixd process. Your editor communicates with it over stdio.
Editor setup
Most editors can use devenv lsp as the Nix language server by pointing the LSP client at it as the server command. The exact configuration depends on your editor and LSP plugin, but the server command to use is:
No additional arguments are needed for standard use — devenv handles all nixd configuration internally.
Printing the generated config
If you need the generated nixd configuration for manual editor setup or debugging:
$ devenv lsp --print-config
This prints the nixd JSON configuration to stdout and exits without starting the server. You can paste the output directly into your editor’s nixd configuration if you prefer to manage it manually.
Use devenv lsp --print-config to inspect exactly which nixpkgs expression and devenv option paths nixd is being pointed at. This is helpful when troubleshooting autocomplete that isn’t resolving the options you expect.