Add README
This commit is contained in:
15
lib.nix
15
lib.nix
@@ -4,6 +4,21 @@ let
|
||||
in
|
||||
with builtins; rec {
|
||||
latestVersion = attrs: (builtins.head (builtins.sort (a: b: (builtins.compareVersions a.version b.version) == 1) (builtins.attrValues (builtins.mapAttrs (version: value: { inherit version value; }) attrs)))).value;
|
||||
|
||||
# From tools.go in arduino-cli
|
||||
# regexpLinuxArm = regexp.MustCompile("arm.*-linux-gnueabihf")
|
||||
# regexpLinuxArm64 = regexp.MustCompile("(aarch64|arm64)-linux-gnu")
|
||||
# regexpLinux64 = regexp.MustCompile("x86_64-.*linux-gnu")
|
||||
# regexpLinux32 = regexp.MustCompile("i[3456]86-.*linux-gnu")
|
||||
# regexpWindows32 = regexp.MustCompile("i[3456]86-.*(mingw32|cygwin)")
|
||||
# regexpWindows64 = regexp.MustCompile("(amd64|x86_64)-.*(mingw32|cygwin)")
|
||||
# regexpMac64 = regexp.MustCompile("x86_64-apple-darwin.*")
|
||||
# regexpMac32 = regexp.MustCompile("i[3456]86-apple-darwin.*")
|
||||
# regexpMacArm64 = regexp.MustCompile("arm64-apple-darwin.*")
|
||||
# regexpFreeBSDArm = regexp.MustCompile("arm.*-freebsd[0-9]*")
|
||||
# regexpFreeBSD32 = regexp.MustCompile("i?[3456]86-freebsd[0-9]*")
|
||||
# regexpFreeBSD64 = regexp.MustCompile("amd64-freebsd[0-9]*")
|
||||
|
||||
selectSystem = system: systems:
|
||||
if system == "aarch64-darwin" then
|
||||
alt (lib.findFirst ({host, ...}: (match "arm64-apple-darwin.*" host) != null) null systems) (selectSystem "x86_64-darwin" systems)
|
||||
|
||||
Reference in New Issue
Block a user