Belated followup, I've tweaked the code to work again. Changes to how rustc vs stdlib is distributed, and, more recently, the multiple output paths PR for nixpkgs, both broke it. Happy Rust+Nix!
The optimal solution is to statically link musl in all releases.
This is possible even when dynamic loading is involved (rustc could be statically linked against the musl dynamic loader, although it's not trivial).
I don't see any purpose for rustup on NixOS. All that home-directory installation stuff is a big hack in comparison IMO. Somebody could make something far smaller to grab the hashes for a specific day however (they are stored at static.rust-lang.org last I checked). Or just use the unsafe fetchurl.
I would like the convenience of rustup coupled with nix-shell's semantics.
There might be a way to do this by passinga derivation (containing the URLs and the hashes) to nix-shell which would do some of the heavy lifting.
However, this would be a different rustup than what everyone else is using and I don't think it should exist unless it's very simple.
One cool thing about nix-shell though is that you make it run nothing (or true) to "install" a toolchain - the effect would be that it's cached until later garbage-collected.
Of course, you could also root it, not sure how painful that is with transient derivations.
What do you mean by simple? What I wrote is quite simple but harder to use because on needs to plug in dates and hashes. I could make it easier to use but then it would be more complex.
I think rooting dev environments should become easier with the new command line. The goal is to have separate tools for debugging derivations vs creating a temp dev environment? The former was nix-shell's original purpose but the latter is its much more common use-case.
Ok I added the ability to pull hashes from the build farm, so one doesn't need to specify them manually. [Security-wise since I do an unverified download to get them in the first place this does nothing, but the extra download of the hash could help guard against network errors I suppose.] One can still specify the hash as before if they want.