From b213bf5bfb4a210320c3bc9c4c3e0efd8f3dc0b9 Mon Sep 17 00:00:00 2001 From: Schuwi Date: Mon, 11 Mar 2024 13:44:25 +0100 Subject: [PATCH 1/4] Fix aarch64 architecture recognition --- lib.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib.nix b/lib.nix index 562153a..e165e00 100644 --- a/lib.nix +++ b/lib.nix @@ -27,9 +27,11 @@ with builtins; rec { else if system == "i686-darwin" then lib.findFirst ({host, ...}: (match "i[3456]86-apple-darwin.*" host) != null) null systems else if system == "aarch64-linux" then - lib.findFirst ({host, ...}: (match "(aarch64|arm64)-linux-gnu" host) != null) null systems + # tools.go uses regexp.MatchString which will also return true for substring matches, so we add a .* to the regex + lib.findFirst ({host, ...}: (match "(aarch64|arm64)-linux-gnu.*" host) != null) null systems else if system == "x86_64-linux" then - lib.findFirst ({host, ...}: (match "x86_64-.*linux-gnu" host) != null) null systems + # also add a .* to the regex here though it is not necessary in the current dataset (March 2024) + lib.findFirst ({host, ...}: (match "x86_64-.*linux-gnu.*" host) != null) null systems else null; convertHash = hash: let m = (match "(SHA-256|SHA-1|MD5):(.*)" hash); From 86e8139e455501f6aa17049fa0dea671001139c2 Mon Sep 17 00:00:00 2001 From: Bouke van der Bijl Date: Tue, 1 Oct 2024 16:36:24 +0200 Subject: [PATCH 2/4] Create 'staging' directory The latest version of the CLI tries to create this dir and errors if it can't --- wrap-arduino-cli.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wrap-arduino-cli.nix b/wrap-arduino-cli.nix index 6b1d7d3..ae24719 100644 --- a/wrap-arduino-cli.nix +++ b/wrap-arduino-cli.nix @@ -22,6 +22,9 @@ let (pkgs.writeTextDir "package_index.json" (builtins.toJSON {packages = [];})) (pkgs.writeTextDir "library_index.json" (builtins.toJSON {libraries = [];})) ]; + postBuild = '' + mkdir -p $out/staging + ''; }; in pkgs.runCommand "arduino-cli-wrapped" { From 6b092895be62078431f6a45df33c35f6f6c758a8 Mon Sep 17 00:00:00 2001 From: Steve Dee Date: Fri, 27 Dec 2024 18:20:25 +0000 Subject: [PATCH 3/4] Remove references to different branches from example in README --- README.md | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 5656d4a..d7dfa2f 100644 --- a/README.md +++ b/README.md @@ -16,16 +16,8 @@ From the indexes you create overlays which then make the Arduino packages and li nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; arduino-nix.url = "github:bouk/arduino-nix"; - arduino-library-index = { - url = "github:bouk/arduino-indexes/library_index"; - flake = false; - }; - arduino-package-index = { - url = "github:bouk/arduino-indexes/package_index"; - flake = false; - }; - arduino-package-rp2040-index = { - url = "github:bouk/arduino-indexes/package_rp2040_index"; + arduino-index = { + url = "github:bouk/arduino-indexes"; flake = false; }; }; @@ -35,17 +27,15 @@ From the indexes you create overlays which then make the Arduino packages and li nixpkgs, flake-utils, arduino-nix, - arduino-package-index, - arduino-package-rp2040-index, - arduino-library-index, + arduino-index, ... }@attrs: let overlays = [ (arduino-nix.overlay) - (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 (arduino-index + "/index/package_index.json")) + (arduino-nix.mkArduinoPackageOverlay (arduino-index + "/index/package_rp2040_index.json")) + (arduino-nix.mkArduinoLibraryOverlay (arduino-index + "/index/library_index.json")) ]; in (flake-utils.lib.eachDefaultSystem (system: From d37e988ceeaf4f4875ef6d251af67a1d65689c7d Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sat, 20 Sep 2025 14:02:42 +0200 Subject: [PATCH 4/4] Use pkgs.fetchurl instead of implicit builtins.fetchurl We do not want or need these downloads at eval time, and it breaks eval/builds in memory-constrained environments. --- libraries.nix | 2 +- packages.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries.nix b/libraries.nix index bfd2c28..c82f548 100644 --- a/libraries.nix +++ b/libraries.nix @@ -19,7 +19,7 @@ let runHook postInstall ''; nativeBuildInputs = [ pkgs.unzip ]; - src = fetchurl ({ + src = pkgs.fetchurl ({ url = url; } // (convertHash checksum)); }; diff --git a/packages.nix b/packages.nix index 4bc3a71..fc7c973 100644 --- a/packages.nix +++ b/packages.nix @@ -26,7 +26,7 @@ let cp -R * "$out/$dirName/" ''; nativeBuildInputs = [ pkgs.unzip ]; - src = fetchurl ({ + src = pkgs.fetchurl ({ url = system.url; } // (convertHash system.checksum)); }; @@ -58,7 +58,7 @@ let runHook postInstall ''; nativeBuildInputs = [ pkgs.unzip ]; - src = fetchurl ({ + src = pkgs.fetchurl ({ url = url; } // (convertHash checksum)); };