From 6d49e13759b5d5545b887cec5a085212fafd5d4f Mon Sep 17 00:00:00 2001 From: August Date: Sat, 28 Nov 2026 19:36:06 -0500 Subject: [PATCH] fix flakae --- .cargo/config.toml | 2 +- .direnv/flake-profile | 1 + .direnv/flake-profile-7-link | 1 + Cargo.toml | 2 +- flake.lock | 37 ++++++++++++++++++++++++++- flake.nix | 49 ++++++++++++++++++++---------------- rust-toolchain.toml | 4 +-- 7 files changed, 69 insertions(+), 27 deletions(-) create mode 120000 .direnv/flake-profile create mode 120000 .direnv/flake-profile-7-link diff --git a/.cargo/config.toml b/.cargo/config.toml index 94270e4..702dded 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -11,7 +11,7 @@ build-std = ["std", "panic_abort"] [env] MCU = "esp32c3" -ESP_IDF_VERSION = "v5.5.3" +ESP_IDF_VERSION = "v6.0.3" ESP_IDF_TOOLS_INSTALL_DIR = "workspace" # Uncomment this if you have moved the target dir by setting CARGO_TARGET_DIR or similar. diff --git a/.direnv/flake-profile b/.direnv/flake-profile new file mode 120000 index 0000000..8e18f4d --- /dev/null +++ b/.direnv/flake-profile @@ -0,0 +1 @@ +flake-profile-7-link \ No newline at end of file diff --git a/.direnv/flake-profile-7-link b/.direnv/flake-profile-7-link new file mode 120000 index 0000000..06011c8 --- /dev/null +++ b/.direnv/flake-profile-7-link @@ -0,0 +1 @@ +/nix/store/ynvkc9rjhvk1na771q4d7c2g23xk1hyr-nix-shell-env \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index a8eec9f..7228085 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ esp-idf-svc = { git = "https://github.com/esp-rs/esp-idf.git" } [dependencies] log = "0.4" -esp-idf-svc = { version = "0.53", features = ["critical-section", "embassy-time-driver", "embassy-sync"] } +esp-idf-svc = { version = "0.54.2", features = ["critical-section", "embassy-time-driver", "embassy-sync"] } # Remove `generic-queue-8` if you plan to use `embassy-time` WITH `embassy-executor` embassy-time = { version = "0.5", features = ["generic-queue-8"] } diff --git a/flake.lock b/flake.lock index 043bec7..4aa7375 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "espidf": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1790779005, + "narHash": "sha256-9k/9GHnFjkkiViqW3olmBlyJGcWbYohFSaVKv+Vvxbs=", + "owner": "hnaderi", + "repo": "espidf-nix", + "rev": "79f70365daf428432a27f940d4d511a7de50a084", + "type": "github" + }, + "original": { + "owner": "hnaderi", + "repo": "espidf-nix", + "type": "github" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -22,6 +40,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1789921291, + "narHash": "sha256-Ft/BRnIqw1MywFoXydKobjjWmDFgDdYtSpJliE8+yUw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "44a91898084f46797b5fac650c7e8c9ac38c43d4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1780145889, "narHash": "sha256-md0zn0RnwNvPyASas1yG5YUuwQ4ALA6ucL50l0DvqCo=", @@ -39,8 +73,9 @@ }, "root": { "inputs": { + "espidf": "espidf", "fenix": "fenix", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" } }, "rust-analyzer-src": { diff --git a/flake.nix b/flake.nix index 16b6ad5..d681874 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,7 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/26.05"; + espidf.url = "github:hnaderi/espidf-nix"; fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -8,34 +9,38 @@ }; outputs = - { nixpkgs, fenix, ... }: + { nixpkgs, fenix, espidf, ... }: let - #lib = pkgs.lib; - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - toolchain = fenix.packages.${system}.fromToolchainName { - name = "nightly-2026-10-18"; - #sha256 = lib.fakeSha256; - sha256 = "/cMB/kOBm9HQsV7Kb5N3n1b/ygfsuoNIChEh/jiS3A8="; + pkgs = import nixpkgs { + overlays = [ + espidf.overlays.default + fenix.overlays.default + ]; + system = "x86_64-linux"; }; + rust-toolchain = pkgs.fenix.fromToolchainFile { + file = ./rust-toolchain.toml; + sha256 = "sha256-/cMB/kOBm9HQsV7Kb5N3n1b/ygfsuoNIChEh/jiS3A8="; + }; + esp-idf = (espidf.lib.mkEspIdf { + inherit pkgs; + idfVersion = "v6.0.3"; + }); in { devShells.x86_64-linux.default = pkgs.mkShell { packages = [ - (toolchain.withComponents [ - "cargo" - "clippy" - "rust-src" - "rustc" - "rustfmt"]) - pkgs.cargo-generate - pkgs.espflash - pkgs.espup - pkgs.ldproxy - (pkgs.python3.withPackages (python-pkgs: with python-pkgs; [ - pip - ])) - ]; + rust-toolchain + esp-idf + pkgs.espflash + pkgs.esp-idf + pkgs.ldproxy + pkgs.llvmPackages.libclang.lib + (pkgs.python3.withPackages (python-pkgs: with python-pkgs; [ + pip + ])) + ]; + nativeBuildInputs = [pkgs.rustPlatform.bindgenHook ]; }; }; } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index f70d225..3d342f4 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly" -components = ["rust-src"] +channel = "nightly-2026-10-18" +components = ["clippy", "rust-src", "rustc", "rustfmt"]