Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Overlaying rust-bin #60

Closed
NickHu opened this issue Mar 5, 2022 · 4 comments
Closed

Overlaying rust-bin #60

NickHu opened this issue Mar 5, 2022 · 4 comments

Comments

@NickHu
Copy link
Contributor

NickHu commented Mar 5, 2022

Is it possible to globally overlay rustc, rustfmt, cargo, etc. for the dev shell and the build environment? I tried to use https://github.com/yusdacra/nix-cargo-integration/blob/master/docs/example_flake.nix#L39 but I wasn't very successful.

In particular, I am interested in using a version of rustc which has the wasm32-unknown-unknown target, e.g. from https://github.com/oxalica/rust-overlay.

@yusdacra
Copy link
Owner

yusdacra commented Mar 5, 2022

If you are trying to add a target, you should use a rust-toolchain.toml file. In your case, this can look like this:

[toolchain]
channel = "nightly-2022-03-05" # or whatever channel you are using
targets = ["wasm32-unknown-unknown", "x86_64-unknown-linux-gnu"]

There isn't yet a way to directly override what toolchain nix-cargo-integration will use, as I haven't yet thought of a good way to expose this. Once #56 is merged, I can work on this more.

@NickHu
Copy link
Contributor Author

NickHu commented Mar 5, 2022

I tried using a toolchain file but it didn't seem to have any effect. Maybe some interaction with cargo workspaces? I put the toolchain file in the root workspace directory next to Cargo.lock

@yusdacra
Copy link
Owner

yusdacra commented Mar 5, 2022

That's interesting. Is it possible for you to share your project? I'd like to take a look at it.

@bobbbay
Copy link

bobbbay commented May 1, 2022

@NickHu did you stage the rust-toolchain.toml in Git? Flakes copy files based on Git, so a new file has to be staged before it sees it.

Repository owner locked and limited conversation to collaborators Oct 30, 2022
@yusdacra yusdacra converted this issue into discussion #94 Oct 30, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants