diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..051d09d --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +eval "$(lorri direnv)" diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000..7aefc74 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1,4 @@ +[toolchain] +channel = "stable" +components = [ "rust-src" ] +targets = [ "thumbv6m-none-eabi" ] diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..8d205bb --- /dev/null +++ b/shell.nix @@ -0,0 +1,20 @@ +# Use nixpkgs with oxalica rust-bin overlay +let + rust_overlay = import (builtins.fetchTarball + "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"); + nixpkgs = import { overlays = [ rust_overlay ]; }; + rust_channel = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain; +in +# Avoid typing `nixpkgs.` before each package name +with nixpkgs; + +# Define the shell +pkgs.mkShell { + buildInputs = [ + dfu-util + ]; + + nativeBuildInputs = [ + rust_channel # Full rust from overlay, includes cargo + ]; +}