basic wubbel

This commit is contained in:
Clara Dautermann 2025-07-02 20:35:23 +02:00
parent dac87a1696
commit 6068827dfb
Signed by: clara
GPG key ID: 223391B52FAD4463
3 changed files with 29 additions and 92 deletions

View file

@ -1,59 +1,31 @@
{
description = "A Nix-flake-based Rust development environment for ESP";
description = "A Nix-flake-based Rust ESP IDF development environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs, rust-overlay }:
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
nixpkgs-esp-dev = builtins.fetchGit {
url = "https://github.com/mirrexagon/nixpkgs-esp-dev.git";
# Optionally pin to a specific commit of `nixpkgs-esp-dev`.
rev = "6c34f2436015eb6c107970d9b88f3d5d4600c6fa";
};
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
pkgs = import nixpkgs { inherit system; overlays = [ (import "${nixpkgs-esp-dev}/overlay.nix") ]; };
});
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";
};
};
});
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
esp-idf-full
espflash
];
};
});
};
}