Nix Rust | 701 Members | |
| Rust | 159 Servers |
| Sender | Message | Time |
|---|---|---|
| 8 Aug 2022 | ||
| Hi, I just installed Rust via Nix, and I’m getting an error when using the rust-analyzer extension for VSCode. “Failed to find sysroot for Cargo.toml file”. It asks if rust-src is installed. How can I install the Rust sources via Nix? | 09:14:04 | |
| Oh, I haven't used vscode in a while, but that error does ring a bell. Do you have rust analyzer itself installed in nix? | 09:15:29 | |
| And is the extension installed through the marketplace, or nix? | 09:15:47 | |
| Yes, I have rust-analyzer installed via Nix. But it might still be using a downloaded version, there was a downloading message. | 09:16:27 | |
| The extension is from the marketplace | 09:16:35 | |
| Ah, maybe it makes sense to try it out with one of the mentioned overlays and to install rust analysis itself. | 09:17:24 | |
| I use a form of the following rust-toolchain.toml usually: ```
| 09:17:47 | |
| * I use a form of the following rust-toolchain.toml usually:
| 09:18:01 | |
| I have downloaded oxalica’s rust overlay and it includes rust-src. I will try using it! | 09:26:42 | |
| Is there a difference between rust-analysis and rust-analyzer? | 09:29:56 | |
| Hmm, it doesn’t seem to discover it | 09:59:38 | |
| It expects it to be installed where rustc is installed, but the command it uses to find that backtracks through the nix profile symlinks back into the store, where they’re separate of course. | 10:00:26 | |
| Does anybody know if this can be fixed? Or should I just use rustup? | 10:00:49 | |
| https://nixos.wiki/wiki/Rust | 11:24:11 | |
| Under shell.nix example is something I have used in the past: ``` Certain Rust tools won't work without thisThis can also be fixed by using oxalica/rust-overlay and specifying the rust-src extensionSee https://discourse.nixos.org/t/rust-src-not-found-and-other-misadventures-of-developing-rust-on-nixos/11570/3?u=samuela. for more details.RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
| 11:24:36 | |
| * Under shell.nix example is something I have used in the past:
| 11:24:48 | |
I am not 100% sure if the path is actually correct anymore I remember having to do something like "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"/lib/src, or something like that. | 11:25:37 | |
In reply to@schuelermine:matrix.org I've had vscode+nix+rust working before, but I've forgotten the exact steps I've used at this point because I use crane now.
But when using rust though a nix devshell, I always add But I also use declarative vscode so I'm not sure if that's a big enough difference here | 13:20:46 | |
In reply to@schuelermine:matrix.org* I've had vscode+nix+rust working before, but I've forgotten the exact steps I've used at this point because I use crane now.
But when using rust though a nix devshell, I always add But I also use declarative vscode so I'm not sure if that's a big enough difference here | 13:20:52 | |
In reply to@schuelermine:matrix.org* I've had vscode+nix+rust working before, but I've forgotten the exact steps I've used at this point because I use crane now.
But when using rust though a nix devshell, I always add But I also use declarative vscode so I'm not sure if that's a big enough difference here | 13:20:57 | |
In reply to @a-kenji:matrix.orgAh, that’s promising! I’ll try that | 13:24:31 | |
In reply to @a-kenji:matrix.orgAs far as I can tell you’d have to use that if you use the rust-src component from that one overlay | 15:09:55 | |
| I managed to make it work :) | 15:22:36 | |
| 9 Aug 2022 | ||
In reply to @schuelermine:matrix.orgWhat made it function in the end? | 06:26:17 | |
| 11 Aug 2022 | ||
| 13:30:58 | ||
In reply to @a-kenji:matrix.orgThe environment variable set to the root directory of rustLibSrc | 21:21:24 | |
| 12 Aug 2022 | ||
| Is there something that I could use to get a package from crates.io installed easily? | 17:18:23 | |
kind of thing? | 17:19:42 | |
| (I know that cargo-udeps is in nixpkgs, but let's say it was something that isn't, and I just want to add it it easily. | 17:20:07 | |
| no, but it shouldn't be hard to make a package | 19:08:50 | |