Do I need overlay (Fenix) for rustc 1.90?

Hi folks,

I tried to build a Rust project using pkgs.rustPlatform.buildRustPackage, but I get an error: requires rustc 1.90.0.

I wonder, do I need to use Fenix overlay, or is there another method to get the newer version of rustc (for example by fetchTarball)?

Thank you.

Well, you could implement an alternative to Fenix yourself, or you could just use Fenix.

Is there any particular reason you’re hesitant to do so?

Thank you @TLATER for the quick answer!

I just want to limit the number of flake inputs, and for example, fetching a tarball from rust-lang.org seems like an easy-to-understand method of building a Rust project. Fenix looks great if I had complicated requirements, but I just need a newer version of rustc.

Obviously, I might be wrong and fetching a tarball wouldn’t be enough to make this work.

That’s what Fenix does, as well as all the complex stuff you need to do on top of that to make those binaries actually work in a nix context. I’d really recommend using Fenix for this instead of reinventing the wheel.

FWIW, you don’t need to use it as an overlay if you’re using flakes (and IMO shouldn’t), you can use the packages output.

OK! Thank you!

I didn’t realize that. I read the docs and I noticed I can:.

          (pkgs.makeRustPlatform rec {
            cargo = rustc;
            rustc = fenix.packages.${system}.stable.toolchain;
          }).buildRustPackage { ...

Very cool, thank you.