Skip to content

Instantly share code, notes, and snippets.

@arawup
Created September 29, 2025 17:23
Show Gist options
  • Select an option

  • Save arawup/fab31a4805fb63cb269a21db1427adb2 to your computer and use it in GitHub Desktop.

Select an option

Save arawup/fab31a4805fb63cb269a21db1427adb2 to your computer and use it in GitHub Desktop.
Prerequisites for VSCode rust-analyzer extension in nixos
## Prerequisites for VSCode rust-analyzer extension in nixos
Make sure to use a custom version preferably from the VSCode marketplace rather than the packaged versions
Some of the packaged versions are really old.
In VSCode Settings set rust-analyzer to local mode rather than download on startup by setting
`"rust-analyzer.server.path" = "rust-analyzer";`
NOTE: this settings changed named across versions or may not be needed for earlier versions. I have only tested 4.2x
NOTE2: also rust-analyzer binary and extensions don't all work together, so make sure they work together as of rn 1.89 with 4.2x work fine
If you don't set it properly for those versions you may get the following errors(all of this are shortened):
- failed to build proc-macro (i got it when i didn't have rust-analyzer anywhere and was using 3.8)
- the binary isn't compatible with the current rust-analyzer version(paraphrased i don't have the original error; get a matching rust-analyzer version both in your flake.nix and the extension)
- failed to bootstrap (I got this when i gave it nix/store path rather than just than tell it to run the cli command)
- Unfortunately we don't ship binaries for your platform yet(you haven't set up the server.path and you are using 4.x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment