Merge pull request #5 from Schuwi/main

Fix aarch64 architecture recognition
This commit is contained in:
Bouke van der Bijl 2024-03-11 14:06:07 +01:00 committed by GitHub
commit 4e0dc359f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,9 +27,11 @@ with builtins; rec {
else if system == "i686-darwin" then else if system == "i686-darwin" then
lib.findFirst ({host, ...}: (match "i[3456]86-apple-darwin.*" host) != null) null systems lib.findFirst ({host, ...}: (match "i[3456]86-apple-darwin.*" host) != null) null systems
else if system == "aarch64-linux" then 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 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; else null;
convertHash = hash: let convertHash = hash: let
m = (match "(SHA-256|SHA-1|MD5):(.*)" hash); m = (match "(SHA-256|SHA-1|MD5):(.*)" hash);