init basic examples and setup
This commit is contained in:
55
flake.nix
Normal file
55
flake.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
description = "Rust on STM32";
|
||||
|
||||
inputs = {
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
rust-overlay,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [(import rust-overlay)];
|
||||
};
|
||||
|
||||
rustToolchain =
|
||||
pkgs.rust-bin.stable."1.95.0".default.override {
|
||||
extensions = [
|
||||
"clippy"
|
||||
"llvm-tools-preview"
|
||||
"rust-src"
|
||||
"rustfmt"
|
||||
];
|
||||
targets = [
|
||||
"thumbv7m-none-eabi"
|
||||
"thumbv6m-none-eabi"
|
||||
];
|
||||
};
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [
|
||||
rustToolchain
|
||||
pkgs.cargo-binutils
|
||||
pkgs.flip-link
|
||||
pkgs.just
|
||||
pkgs.llvmPackages.bintools
|
||||
pkgs.probe-rs
|
||||
];
|
||||
|
||||
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library";
|
||||
|
||||
shellHook = ''
|
||||
echo "Rust on STM32 dev shell"
|
||||
echo "Default target: thumbv7m-none-eabi"
|
||||
echo "Flash and run commands use PROBE_RS_CHIP if you need to override the default."
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user