···912912913913As of writing, this prints out `rustc 1.56.0 (09c42c458 2021-10-18)`.
914914915915+### How to use an overlay toolchain in a derivation {#how-to-use-an-overlay-toolchain-in-a-derivation}
916916+917917+You can also use an overlay's Rust toolchain with `buildRustPackage`.
918918+The below snippet demonstrates invoking `buildRustPackage` with an oxalica overlay selected Rust toolchain:
919919+```nix
920920+with import <nixpkgs>
921921+{
922922+ overlays = [
923923+ (import (fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
924924+ ];
925925+};
926926+927927+rustPlatform.buildRustPackage rec {
928928+ pname = "ripgrep";
929929+ version = "12.1.1";
930930+ nativeBuildInputs = [
931931+ rust-bin.stable.latest.minimal
932932+ ];
933933+934934+ src = fetchFromGitHub {
935935+ owner = "BurntSushi";
936936+ repo = pname;
937937+ rev = version;
938938+ sha256 = "1hqps7l5qrjh9f914r5i6kmcz6f1yb951nv4lby0cjnp5l253kps";
939939+ };
940940+941941+ cargoSha256 = "03wf9r2csi6jpa7v5sw5lpxkrk4wfzwmzx7k3991q3bdjzcwnnwp";
942942+943943+ meta = with lib; {
944944+ description = "A fast line-oriented regex search tool, similar to ag and ack";
945945+ homepage = "https://github.com/BurntSushi/ripgrep";
946946+ license = licenses.unlicense;
947947+ maintainers = [ maintainers.tailhook ];
948948+ };
949949+}
950950+```
951951+952952+Follow the below steps to try that snippet.
953953+1. create a new directory
954954+1. save the above snippet as `default.nix` in that directory
955955+1. cd into that directory and run `nix-build`
956956+915957### Rust overlay installation {#rust-overlay-installation}
916958917959You can use this overlay by either changing your local nixpkgs configuration,