Skip to content

Instantly share code, notes, and snippets.

@matthewtapps
Created February 6, 2025 23:55
Show Gist options
  • Save matthewtapps/8b62b0180b08f90df92607b92e7d4fde to your computer and use it in GitHub Desktop.
Save matthewtapps/8b62b0180b08f90df92607b92e7d4fde to your computer and use it in GitHub Desktop.
Rust Custom Toolchain Nix Shell
let
rust-overlay = builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz";
pkgs = import <nixpkgs> {
overlays = [ (import rust-overlay) ];
};
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./toolchain.toml;
in
pkgs.mkShell {
packages = [
toolchain
];
nativeBuildInputs = with pkgs; [
rustc
cargo
gcc
rustfmt
clippy
rust-analyzer
];
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment