teach your editor pure functional package manager.
I just published a re-designed language server which performs package & nixos/home-manager/nix-darwin options completion, goto definition, syntax errors, liveness, missing “;” … these features works out of box,
When I last tried setting up nixd, I hit a roadblock configuring the .nixd.json files. From the changelog I take it that these are no longer necessary?
One primary purpose of .nixd.json is to determine the target for evaluation. However, based on my experience with “nix,” evaluating “all” files on workspace updates is a technique more suitable for “one-time” checks rather than on-the-fly editing. Consequently, evaluation per node has been eliminated. Now, packages completion and options completion operate akin to querying an REPL but communicate programmatically via RPC (Remote Procedure Call). In this approach, evaluated results remain unaffected by workspace changes.
For instance, the frontend heuristically matches with pkgs; constructs and queries the “REPL” for package definitions, subsequently displaying completions and documentations. This means it now aligns with certain “idioms” in the nix language, without fully evaluating everything and risking invalidation immediately after workspace changes.
While not perfect or exact, this approach represents a tradeoff considering performance & experience.
Excelent! I love the feature to go-to-definition on nixpkgs options. It would be nice if I could also go-to-definition of my own personal modules. There should be a way for the lsp to grab information from the flakes itself, right?