Created
February 6, 2025 23:55
-
-
Save matthewtapps/8b62b0180b08f90df92607b92e7d4fde to your computer and use it in GitHub Desktop.
Rust Custom Toolchain Nix Shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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