From e3fd07a28e23ed21fd4aade4bf03e5211009dc61 Mon Sep 17 00:00:00 2001 From: Robert Schauklies Date: Thu, 8 Jan 2026 22:08:39 +0100 Subject: [PATCH] because of fuckery, we are using the oxalica overlay now --- spinnyboy_rust/shell.nix | 43 ++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/spinnyboy_rust/shell.nix b/spinnyboy_rust/shell.nix index 8570f2f..c4f8346 100644 --- a/spinnyboy_rust/shell.nix +++ b/spinnyboy_rust/shell.nix @@ -1,19 +1,28 @@ -{ pkgs ? import {}}: -let rust-toolchain = with pkgs; symlinkJoin { - name = "rust-toolchain"; - paths = [ - probe-rs-tools - rustup - rustc - cargo - rustfmt - rust-analyzer - clippy - rustPlatform.rustcSrc +{ pkgs ? import { + overlays = [ + (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")) ]; - }; -in pkgs.mkShell { - buildInputs = [rust-toolchain]; - RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; - RUST_BACKTRACE = 1; + } +}: + +let + # Define the specific toolchain with ESP32-C6 support + rustToolchain = pkgs.rust-bin.selectLatestNightlyWith(toolchain: toolchain.default.override { + targets = [ "riscv32imac-unknown-none-elf" ]; + extensions = [ "rust-src" "llvm-tools-preview" ]; + }); +in +pkgs.mkShell { + nativeBuildInputs = [ + rustToolchain + pkgs.probe-rs-tools + pkgs.espflash # For flashing your ESP32-C6 + pkgs.pkg-config + pkgs.gcc # Critical: provides the 'cc' wrapper script + ]; + + # Injects necessary library paths for the Nix-wrapped linker + shellHook = '' + export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc ]}" + ''; }