59 lines
1.6 KiB
Nix
59 lines
1.6 KiB
Nix
{
|
|
description = "A Nix-flake-based Rust development environment for ESP";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, rust-overlay }:
|
|
let
|
|
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
|
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [ rust-overlay.overlays.default ];
|
|
};
|
|
});
|
|
in
|
|
{
|
|
devShells = forEachSupportedSystem ({ pkgs }:
|
|
let
|
|
rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./firmware/rust-toolchain.toml;
|
|
in
|
|
{
|
|
default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
rust-toolchain
|
|
cargo-flamegraph
|
|
espup
|
|
|
|
ldproxy
|
|
|
|
gcc
|
|
git
|
|
gnumake
|
|
flex
|
|
bison
|
|
gperf
|
|
python313
|
|
cmake
|
|
ninja
|
|
ccache
|
|
dfu-util
|
|
libusb1
|
|
python313Packages.pip
|
|
|
|
esp-generate
|
|
|
|
espflash
|
|
probe-rs
|
|
];
|
|
env = {
|
|
LIBCLANG_PATH = "/home/clara/.rustup/toolchains/esp/xtensa-esp32-elf-clang/esp-19.1.2_20250225/esp-clang/lib";
|
|
PATH = "/home/clara/.rustup/toolchains/esp/xtensa-esp-elf/esp-14.2.0_20240906/xtensa-esp-elf/bin:$PATH";
|
|
};
|
|
};
|
|
});
|
|
};
|
|
}
|