{ inputs = { rust-overlay.url = "github:oxalica/rust-overlay/stable"; nixpkgs.follows = "rust-overlay/nixpkgs"; }; outputs = { nixpkgs, rust-overlay, ... }: let forAllSystems = f: nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ] ( system: f { pkgs = import nixpkgs { inherit system; overlays = [(import rust-overlay)]; }; } ); in { devShells = forAllSystems ({pkgs}: { default = with pkgs; mkShell { packages = [ bashInteractive coreutils just pkg-config (rust-bin.fromRustupToolchainFile ./rust-toolchain.toml) probe-rs cargo-bloat cargo-binutils ]; shellHook = '' project_root="$(git rev-parse --show-toplevel) # Avoid polluting home dir with local project stuff. if command -v git &> /dev/null; then CARGO_HOME="$project_root/.cargo" export CARGO_HOME export PATH=$PATH:$CARGO_HOME/bin fi # Load './.env' file if available. dotenv="$project_root/.env" if [[ -e "$dotenv" ]]; then set -o allexport source "$dotenv" set +o allexport fi ''; }; }); }; }