Refactor README and flake.nix for improved development environment setup; remove embedded Rust tooling references and add Cargo productivity tools

This commit is contained in:
2026-05-23 09:56:42 -05:00
parent 6a825d1e83
commit 5794b593fa
3 changed files with 28 additions and 61 deletions
+16 -33
View File
@@ -60,30 +60,22 @@
{
default = pkgs.mkShell {
packages = with pkgs; [
# Rust toolchain (managed by fenix overlay)
rustToolchain
rust-analyzer
# Build essentials
git
gnumake
openssl
pkg-config
# Cargo productivity tools
cargo-deny
cargo-edit
cargo-watch
cargo-generate
rust-analyzer
rustup
# Embedded Rust tooling
probe-rs-tools
espflash
openocd
minicom
# RP2040 UF2 workflows
elf2uf2-rs
picotool
avrdude
pkgsCross.avr.buildPackages.libc
pkgsCross.avr.buildPackages.gcc
ravedude
# Code quality
pre-commit
# Packaging
flatpak-builder
];
env = {
@@ -98,20 +90,9 @@
echo " Initialized git repository"
fi
# Ensure user's Cargo-installed binaries are available
export PATH="$HOME/.cargo/bin:$PATH"
if command -v rustup >/dev/null 2>&1; then
echo "Ensuring common embedded Rust targets are available (idempotent)..."
rustup target add thumbv6m-none-eabi >/dev/null 2>&1 || true # Cortex-M0/M0+ (RP2040)
rustup target add thumbv7em-none-eabihf >/dev/null 2>&1 || true # Cortex-M4F/M7F (many STM32/nRF52)
rustup target add riscv32imc-unknown-none-elf >/dev/null 2>&1 || true
rustup target add riscv32imac-unknown-none-elf >/dev/null 2>&1 || true # ESP32-C3 class
echo "Note: ESP32 Xtensa targets require espup/custom toolchains (see esp-rs)."
fi
echo "[FeDIY] Welcome to the Rust dev shell!"
echo "Tools: cargo, rustc, clippy, rustfmt, rust-analyzer, probe-rs, espflash, openocd, minicom, elf2uf2-rs, picotool, avrdude, ravedude"
echo "Run 'cargo build' to build, or 'nix run .#dev-helper' for a tool summary."
echo "[FeDIY] Welcome to the dev shell!"
echo "Tools: cargo, rustc, clippy, rustfmt, rust-analyzer, flatpak-builder"
echo "Run 'cargo build' to build, 'make flatpak-build' for Flatpak, or 'nix run .#dev-helper' for a tool summary."
echo "See README.md for usage."
'';
};
@@ -130,10 +111,12 @@
};
devHelper = pkgs.writeShellScriptBin "dev-helper" ''
echo "Rust toolchain available:"
command -v cargo >/dev/null 2>&1 && cargo --version || true
command -v rustc >/dev/null 2>&1 && rustc --version || true
echo "This binary is built by Nix (packages.default)."
echo "=== FeDIY dev shell tools ==="
command -v cargo >/dev/null 2>&1 && echo "cargo: $(cargo --version)" || echo "cargo: not found"
command -v rustc >/dev/null 2>&1 && echo "rustc: $(rustc --version)" || echo "rustc: not found"
command -v rust-analyzer >/dev/null 2>&1 && echo "rust-analyzer: $(rust-analyzer --version)" || echo "rust-analyzer: not found"
command -v flatpak-builder >/dev/null 2>&1 && echo "flatpak-builder: $(flatpak-builder --version)" || echo "flatpak-builder: not found"
command -v pre-commit >/dev/null 2>&1 && echo "pre-commit: $(pre-commit --version)" || echo "pre-commit: not found"
'';
}
);