Installing Rust with Nix
- The NixPkgs stock repository has a rust package, though it often lags behind by a version or two
- nixpkgs-mozilla has an overlay with functions to download arbitrary Rust builds
Building Rust software with Nix
NixPkgs has two functions for building code with the Rust toolchain.
- rustPlatform.buildRustPackage invokes
cargowith an appropriate environment.
- rustPlatform.buildRustCrate invokes
rustcdirectly to build a crate.
- Nix MozJS Tutorial: how to use crate2nix to build a complicated Rust application directly with Nix.