Skip to content

Documentation / support for configuring for use with Nixd? #8474

Closed Answered by crabdancing
crabdancing asked this question in Q&A
Discussion options

You must be logged in to vote

In case it helps anyone, here's a rendered example of my (working) config for a flake-based NixOS system, which has been working reliably for me for the past couple years:

[language-server.nixd]
command = "nixd"

[language-server.nixd.formatting]
command = ["alejandra"]

[language-server.nixd.nixpkgs]
expr = "import (builtins.getFlake \"/etc/nixos\").inputs.nixpkgs { }"

[language-server.nixd.options.nixos]
expr = "(builtins.getFlake \"/etc/nixos\").nixosConfigurations.<HOSTNAME>.options"

Substitute for whatever you want. In my case, I use home-manager, so I configure it from a home-manager context like so:

programs.helix.languages = {
language-server.rust-analyzer.config = {
  checkOnSave.

Replies: 6 comments 11 replies

Comment options

You must be logged in to vote
3 replies
@kirawi
Comment options

kirawi Oct 6, 2023
Collaborator

@kirawi
Comment options

kirawi Oct 6, 2023
Collaborator

@crabdancing
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@the-mikedavis
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@arthsmn
Comment options

@Lillecarl
Comment options

@arthsmn
Comment options

@Lillecarl
Comment options

@arthsmn
Comment options

Comment options

You must be logged in to vote
1 reply
@Malix-Labs
Comment options

Answer selected by crabdancing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants
Converted from issue

This discussion was converted from issue #8472 on October 06, 2023 14:21.