From 05be1c452844539c33057d5a48a778b47ed6db9a Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 3 Dec 2023 16:49:29 +0100 Subject: [PATCH] Explain runtimeInputs for special platforms --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index df3a555..1373ed9 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,10 @@ From the indexes you create overlays which then make the Arduino packages and li (arduino-nix.mkArduinoPackageOverlay (arduino-package-index + "/package_index.json")) (arduino-nix.mkArduinoPackageOverlay (arduino-package-rp2040-index + "/package_rp2040_index.json")) (arduino-nix.mkArduinoLibraryOverlay (arduino-library-index + "/library_index.json")) + (arduino-nix.mkArduinoPackageOverlay (pkgs.fetchurl { + url = "https://raw.githubusercontent.com/espressif/arduino-esp32/8bae7e23376c6087a55e46456049ae6d73b72e16/package_esp32_index.json"; + hash = "sha256-0kvZeRDtE/JKJes86omyN4cf4HWfX68P7xPfE+BvTC8="; + })) ]; in (flake-utils.lib.eachDefaultSystem (system: @@ -54,7 +58,7 @@ From the indexes you create overlays which then make the Arduino packages and li inherit system overlays; }; - // arduinoEnv provides bin/arduino-cli and some useful helpers functions + # arduinoEnv provides bin/arduino-cli and some useful helpers functions arduinoEnv = pkgs.makeArduinoEnv { libraries = with pkgs.arduinoLibraries; [ (arduino-nix.latestVersion ADS1X15) @@ -69,6 +73,18 @@ From the indexes you create overlays which then make the Arduino packages and li platforms.rp2040.rp2040."2.3.3" ]; }; + + arduinoEnvESP32 = pkgs.makeArduinoEnv { + packages = with pkgs.arduinoPackages; [ + platforms.esp32.esp32."2.0.14" + ]; + + # ESP32 tools require python with some custom dependencies + # we can provide them via runtimeInputs + runtimeInputs = with pkgs; [ + (python3.withPackages(ps: with ps; [ pyserial ])) + ]; + }; in rec { packages = { inherit arduinoEnv; @@ -78,6 +94,12 @@ From the indexes you create overlays which then make the Arduino packages and li src = ./. + "/my-rp2040-project"; fqbn = "arduino:mbed_rp2040:pico"; }; + + my-esp32-poe-iso-project = arduinoEnvESP32.buildArduinoSketch { + name = "my-esp32-poe-iso-project"; + src = ./. + "/my-esp32-poe-iso-project"; + fqbn = "esp32:esp32:esp32-poe-iso"; + }; } )); }