Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I enable NixOS, Flake-parts, and Home-manager options at the same time when using nixd? #363

Open
sylvester-roos opened this issue Oct 25, 2023 · 1 comment

Comments

@sylvester-roos
Copy link

sylvester-roos commented Oct 25, 2023

The example in the README is not very clear on this. Copying this example leads to the obvious duplicate key errors, but there's also the <name> part. Is this supposed to be my username? Should it be .<myname>. or .myname.? Thanks

Relevant config:

"nix.serverSettings": {
    // settings for 'nixd' LSP
    "formatting": {
        "command": "nixpkgs-fmt"
    },
    "options": {
        "enable": true,
        "target": {
            // tweak arguments here
            "args": [],
            // NixOS options
            "installable": "<flakeref>#nixosConfigurations.<name>.options",
            // Flake-parts options
            "installable": "<flakeref>#debug.options",
            // Home-manager options
            "installable": "<flakeref>#homeConfigurations.<name>.options"
        }
    }
}
@spikespaz
Copy link

Currently not possible, as I understand. I requested of the author of Nixd to implement this for flakes, but as I understand, he doesn't use flakes and only supports such usage through flake-compat. That is until @edolstra finishes source tree abstraction, which would allow the LSP to provide file paths relative to your git directory.

Even still, if you manage to hack something together, you have to choose one installable or one expression, unless you want to create .vscode/settings.nix for each subdirectory of your flake.

I encourage you to pester the author of Nixd to implement a reasonable (even if hacky) solution to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants