Contributing rust project to nixpkgs - requires fenix for rustup components

I’m wanting to submit a package to nixpkgs, however I’ve only managed to build the project via a flake with fenix.

This is what I have with my flake to specify the toolchain:

fnx = fenix.packages.${system};

toolchain = (with fnx; with stable; combine [
	rustc
	cargo
	llvm-tools-preview
	targets.wasm32-unknown-unknown.stable.rust-std
]);

rustPlatform = pkgs.makeRustPlatform {
	rustc = toolchain;
	cargo = toolchain;
};

My main question here then is - how do I do include fenix for this within a default.nix for a derivation for nixpkgs? Or is there another way to do this?

I’m 99.9% sure this kind of PR would not be accepted, fwiw.

Very likely, the stdlib stuff is surprisingly capable. I don’t know the answer firsthand and I’m concerned that it may touch on cross-compilation which I haven’t had to learn about yet. You may get a little further if you read this manual section:

What’s the software you want to package, just out of curiosity? Most WASM things I’m acquainted with still need something else to be useful, some host/runtime application that evaluates it.

My question is more on how do I import fenix in a default.nix rather than by a flake. Is it ok to just fetchFromGithub for it in nixpkgs?

The application is rerun-cli - it’s a visualisation tool for computer vision/robotics. It contains both a native viewer and a web-viewer, hence it needs the wasm.

My point was that the nixpkgs reviewers are extremely unlikely to accept a PR that introduces an external dependency on fenix, or any other community code that lives outside nixpkgs’ repo. Since that was your stated goal, I wanted to warn you it’s probably a non-starter tactic.

Ok - I guess I’ll have to just put it in my NUR repository then.