oxalica / nil

NIx Language server, an incremental analysis assistant for writing in Nix.
Apache License 2.0
1.28k stars 39 forks source link

nixpkgs options autocomplete for /etc/nixos/configuration.nix #140

Open anabelle2001 opened 2 months ago

anabelle2001 commented 2 months ago

Hello, I've configured nil in vscode, but i don't see package options autocompleting when pressing ctrl+space to invoke intelisense while editing </etc/nixos/configuration.nix>.

I suspect this is down to misconfiguration on my own end, but I cannot tell if this is due to a misconfiguration of vscode, a misconfiguration of nil, or me misunderstanding the scope of the project. my guess is that i'm within the use case described in docs/features.md:42, but i'm honestly not 100% sure anymore. :woozy_face:

here's a screenshot of my editor. I'm expecting to see nil populate autocomplete entries.

image

wesdgray commented 2 months ago

I'm looking to get this working for myself too. When looking at the release history it seems this does exist but in the notes it says it requires a working flake setup. I'm fairly new to this so I might be wrong here but that seems to imply that we would need to run the language server from a nixos system. I'm going to try to figure this out and report back, but if you figure anything out please comment back on this issue too.

wesdgray commented 2 months ago

@anabelle2001 I ended up giving up and installed nixd. That seemed to work for me. It did require some different setup since I am running nixos in a vm on my windows machine. I was running vscode on my windows host and using ssh to connect to my nixos vm. I needed to install vscode server on my nixos machine and ensure the nix-ide extension was installed on that nixos machine not my host machine. I also needed to ensure nixd was installed and then restart vscode.