{ pkgs ? import <nixpkgs> {} }:
/*
based on
https://discourse.nixos.org/t/how-can-i-set-up-my-rust-programming-environment/4501/9
*/
let
rust_overlay = import (builtins.fetchTarball {
url = "https://github.com/oxalica/rust-overlay/archive/a16b9a7cac7f4d39a84234d62e91890370c57d76.tar.gz";
sha256 = "sha256:05xyk469bj6zkvkk4gmc58rkiyavamn4xhfglwkdqlanqiyfwdfz";
});
pkgs = import <nixpkgs> { overlays = [ rust_overlay ]; };
rust = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml);
in
pkgs.mkShell {
buildInputs = [
rust
] ++ (with pkgs; [
pkg-config
rust-analyzer
sccache
]);
RUST_BACKTRACE = 1;
RUSTC_WRAPPER = "sccache";
}