From 4e211522c7db161518f18cc9beddd8ed49add2c7 Mon Sep 17 00:00:00 2001 From: David Barroso Date: Tue, 6 Aug 2024 10:37:08 +0200 Subject: [PATCH] feat: added support for arm64 runners --- flake.nix | 2 +- nix-quick-install.sh | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index ae2e3d6..a1bf3ce 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,7 @@ flake-utils, nixpkgs-unstable, }: - let allSystems = ["x86_64-linux" "x86_64-darwin"]; + let allSystems = [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ]; in flake-utils.lib.eachSystem allSystems (system: let diff --git a/nix-quick-install.sh b/nix-quick-install.sh index c1bb243..d57066a 100755 --- a/nix-quick-install.sh +++ b/nix-quick-install.sh @@ -5,13 +5,28 @@ set -o pipefail source "${BASH_SOURCE[0]%/*}/vercomp.sh" +case "$(uname -m)" in + x86_64) + arch="x86_64" + ;; + arm64) + sys="aarch64" + ;; + aarch64) + arch="aarch64" + ;; + *) + echo >&2 "unsupported architecture: $(uname -m)" + exit 1 +esac + # Figure out system type (TODO don't assume x86_64) case "$OSTYPE" in darwin*) - sys="x86_64-darwin" + sys="$arch-darwin" ;; linux*) - sys="x86_64-linux" + sys="$arch-linux" ;; *) echo >& "unsupported OS type: $OSTYPE"