Skip to content
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

Demonstrate how to use custom Rust toolchains #61

Open
zmitchell opened this issue Nov 4, 2024 · 0 comments
Open

Demonstrate how to use custom Rust toolchains #61

zmitchell opened this issue Nov 4, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@zmitchell
Copy link
Contributor

For Rust projects that need to target architectures other than the architecture of their machine, you typically install support for those targets with rustup. Similarly, if you need to use the nightly compiler you would install and manage that with rustup as well. With Flox you want a declarative way to manage the project's dependencies. One solution for this is to use a flake.

Using the fenix flake you can do both of these things. For the nightly toolchain you only need nightly-rust.flake = "github:nix-community/fenix#default.toolchain" instead of the packages in the rust-toolchain of the existing example environment. To support other targets you need to write your own flake. The packages output of your flake would look something like this (I think):

packages.${system}.withWasm =
    fenix.${system}.packages.combine [
        fenix.${system}.packages.stable
        fenix.${system}.packages.targets.wasm32-unknown-unknown.default
    ];

and then you would add that flake to your manifest.

@zmitchell zmitchell added the documentation Improvements or additions to documentation label Nov 4, 2024
@zmitchell zmitchell self-assigned this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant