!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

705 Members
Rust162 Servers

Load older messages


SenderMessageTime
8 Aug 2022
@a-kenji:matrix.orga-kenji

I use a form of the following rust-toolchain.toml usually: ```
[toolchain]
channel = "1.62.0"
components = ["rustfmt", "clippy", "rust-analysis"]
targets = []

09:17:47
@a-kenji:matrix.orga-kenji *

I use a form of the following rust-toolchain.toml usually:

\[toolchain\]
channel = "1.62.0"
components = \["rustfmt", "clippy", "rust-analysis"\]
targets = \[\]
09:18:01
@schuelermine:matrix.orgschuelermineI have downloaded oxalica’s rust overlay and it includes rust-src. I will try using it!09:26:42
@schuelermine:matrix.orgschuelermineIs there a difference between rust-analysis and rust-analyzer?09:29:56
@schuelermine:matrix.orgschuelermineHmm, it doesn’t seem to discover it09:59:38
@schuelermine:matrix.orgschuelermineIt 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
@schuelermine:matrix.orgschuelermineDoes anybody know if this can be fixed? Or should I just use rustup?10:00:49
@a-kenji:matrix.orga-kenjihttps://nixos.wiki/wiki/Rust11:24:11
@a-kenji:matrix.orga-kenji

Under shell.nix example is something I have used in the past: ```

Certain Rust tools won't work without this

This can also be fixed by using oxalica/rust-overlay and specifying the rust-src extension

See 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
@a-kenji:matrix.orga-kenji *

Under shell.nix example is something I have used in the past:

# Certain Rust tools won't work without this

# This can also be fixed by using oxalica/rust-overlay and specifying the rust-src extension

# See 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:48
@a-kenji:matrix.orga-kenji 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
@kayla.fire:matrix.orgkayla (she/they)
In reply to@schuelermine:matrix.org
Does anybody know if this can be fixed? Or should I just use rustup?

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 nativeBuildInputs = [ cargo rustc ]; to a mkShell invocation and then launch vscode from that devshell, to make rust-analyzer work. I've basically found that to get rust-analyzer to work I've gotta launch vscode from the devshell for the project

But I also use declarative vscode so I'm not sure if that's a big enough difference here

13:20:46
@kayla.fire:matrix.orgkayla (she/they)
In reply to@schuelermine:matrix.org
Does anybody know if this can be fixed? Or should I just use rustup?
*

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 nativeBuildInputs = [ cargo rustc ]; to a mkShell invocation and then launch vscode from that devshell, to make rust-analyzer work. I've basically found that to get rust-analyzer to work I've gotta launch vscode from the devshell for the project.

But I also use declarative vscode so I'm not sure if that's a big enough difference here

13:20:52
@kayla.fire:matrix.orgkayla (she/they)
In reply to@schuelermine:matrix.org
Does anybody know if this can be fixed? Or should I just use rustup?
*

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 nativeBuildInputs = [ cargo rustc ]; to a mkShell invocation and then launch vscode from that devshell, to make rust-analyzer work. I've basically found that to get rust-analyzer to work I've gotta launch vscode from the devshell for the project.

But I also use declarative vscode so I'm not sure if that's a big enough difference here

13:20:57
@schuelermine:matrix.orgschuelermine
In reply to @a-kenji:matrix.org

Under shell.nix example is something I have used in the past:

# Certain Rust tools won't work without this

# This can also be fixed by using oxalica/rust-overlay and specifying the rust-src extension

# See 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}";
Ah, that’s promising! I’ll try that
13:24:31
@schuelermine:matrix.orgschuelermine
In reply to @a-kenji:matrix.org
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.
As 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
@schuelermine:matrix.orgschuelermineI managed to make it work :)15:22:36
9 Aug 2022
@a-kenji:matrix.orga-kenji
In reply to @schuelermine:matrix.org
I managed to make it work :)
What made it function in the end?
06:26:17
11 Aug 2022
@denna:matrix.orgolaf changed their display name from denna to olaf.13:30:58
@schuelermine:matrix.orgschuelermine
In reply to @a-kenji:matrix.org
What made it function in the end?
The environment variable set to the root directory of rustLibSrc
21:21:24
12 Aug 2022
@dpc:matrix.orgdpcIs there something that I could use to get a package from crates.io installed easily?17:18:23
@dpc:matrix.orgdpc
cargo-updeps = lib.crateFromCratesIO { name: "cargo-udeps"; version = "1.0"; sha256= "..."; };

kind of thing?

17:19:42
@dpc:matrix.orgdpc(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
@qyliss:fairydust.spaceAlyssa Rossno, but it shouldn't be hard to make a package19:08:50
13 Aug 2022
@dpc:matrix.orgdpc Seems like nixpkgs has fetchCrate and then I just plugged it into crane's buildPackage's src = 02:23:27
@yuu:matrix.orgyuu changed their display name from yuu to yuu[m].03:15:40
@yuu:matrix.orgyuu changed their display name from yuu[m] to yuu.05:06:09
@yuka:yuka.devYureka (she/her)https://github.com/NixOS/nixpkgs/pull/18644312:47:27
@yuka:yuka.devYureka (she/her)If anyone has an idea how to debug the cargo bootstrap failure, help would be highly appreciated: https://termbin.com/ut9m 12:48:08
14 Aug 2022
@weebsorceress:matrix.orgWeebSorceress joined the room.19:06:16

Show newer messages


Back to Room ListRoom Version: 6