Skip to content

Instantly share code, notes, and snippets.

@storopoli
Last active July 18, 2025 16:14
Show Gist options
  • Save storopoli/10002dcfa7e65967ce320d03d99de383 to your computer and use it in GitHub Desktop.
Save storopoli/10002dcfa7e65967ce320d03d99de383 to your computer and use it in GitHub Desktop.
Custom Rust in Nix Shell
let
rust-overlay = import (builtins.fetchTarball {
url = "https://github.com/oxalica/rust-overlay/archive/master.tar.gz";
# Optionally pin to specific commit:
# url = "https://github.com/oxalica/rust-overlay/archive/COMMIT_HASH.tar.gz";
});
in
with import <nixpkgs> { overlays = [ rust-overlay ]; };
mkShell {
buildInputs = [
bashInteractive
# rust-bin.nightly.latest.default # or any other
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
];
}
@storopoli
Copy link
Author

echo "use nix" >> .envrc
direnv allow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment