nixd
Loading...
Searching...
No Matches
Features in nixd

‍[!TIP] Use environment variable NIXD_FLAGS if you cannot pass args to nixd easily.

For example:

export NIXD_FLAGS="--inlay-hints=false"

Inlay Hints

Inlay hints, in nixd, is used for give you package versions in your system configuration. It will make a "floating" text right after the package name, with it's version.

Version strings are evaluated by name.version attrpath, it should be consistent with your configured nixpkgs. Read the configuration docs if you don't know how to setup.

with pkgs; [
nix: 2.19.0
# ~~~~~~~~~~~~~~ <-- the version, floating.
]

Screenshots:

inlay hints

‍[!TIP] Use --inlay-hints=false to completely disable the feature.

Semantic Tokens

nixd language server tries to make some tokens looks different by sending your editor some integers. However, types in nix language is pretty different from standard LSP types. So, as a result, attrnames, selection, variables are colored as different integers, but the colors may, or may not rendered properly in your editor.

‍[!TIP] --semantic-tokens=false to disable the feature.

Attribute name coloring

Colors may be different for attribute path creating nested attribute set between the path just "select"s into it.

{
foo.bar = 1;
# ~~~ ~~~ <----- these two tokens should be colored as same
foo.x = 2;
# ~~~ <----- this token, however will not be colored as same as "foo.bar"
}

For the attribute path foo.bar, it creates "nested" attribute set, under "foo".

{
foo = {
# ^~~ <-------- new !
bar = 1;
# <------- new !
};
}

And the second, foo.x, just make a new "entry" in "foo"

{
foo = {
bar = 1;
x = 2;
# <---- new !
};
}

For example in my editor setup they looks like:

semantic tokens, bootspec

Thus you can only look at "darker" attrset, which really creates something different.

For example in this picture you can only focus .availableKernelModules, in boot.initrd.availableKernelModules.