From 1fefe808f65f9545f2f112229bf38adc626aed07 Mon Sep 17 00:00:00 2001 From: Finn Behrens Date: Thu, 27 May 2021 12:05:13 +0200 Subject: [PATCH 1/2] enable aarch64-darwin build disable lowdown sandbox on aarch64-darwin --- flake.lock | 8 ++++---- flake.nix | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index 06c507e7d..325e01fb8 100644 --- a/flake.lock +++ b/flake.lock @@ -19,16 +19,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1614309161, - "narHash": "sha256-93kRxDPyEW9QIpxU71kCaV1r+hgOgP6/aVgC7vvO8IU=", + "lastModified": 1622503062, + "narHash": "sha256-5QHhFydG1+ImYjeE7XLrPbCUZhWcSYrebXpYuY0XWz4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0e499fde7af3c28d63e9b13636716b86c3162b93", + "rev": "3a2e0c36e79cecaf196cbea23e75e74710140ea4", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-20.09-small", + "ref": "nixos-21.05-small", "type": "indirect" } }, diff --git a/flake.nix b/flake.nix index a445c7763..1bb05e6d7 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "The purely functional package manager"; - inputs.nixpkgs.url = "nixpkgs/nixos-20.09-small"; + inputs.nixpkgs.url = "nixpkgs/nixos-21.05-small"; inputs.lowdown-src = { url = "github:kristapsdz/lowdown/VERSION_0_8_4"; flake = false; }; outputs = { self, nixpkgs, lowdown-src }: @@ -286,8 +286,8 @@ nativeBuildInputs = [ which ]; - configurePhase = - '' + configurePhase = '' + ${if (stdenv.isDarwin && stdenv.isAarch64) then "echo \"HAVE_SANDBOX_INIT=false\" > configure.local" else ""} ./configure \ PREFIX=${placeholder "dev"} \ BINDIR=${placeholder "bin"}/bin From 9f1a7f9d370b17d760b5f97ae73118cabc099590 Mon Sep 17 00:00:00 2001 From: Finn Behrens Date: Tue, 1 Jun 2021 09:48:35 +0200 Subject: [PATCH 2/2] Include aarch64-darwin in installer Co-authored-by: Matthew Bauer --- flake.nix | 2 +- scripts/install.in | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 1bb05e6d7..6c65e3406 100644 --- a/flake.nix +++ b/flake.nix @@ -387,7 +387,7 @@ # to https://nixos.org/nix/install. It downloads the binary # tarball for the user's system and calls the second half of the # installation script. - installerScript = installScriptFor [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ]; + installerScript = installScriptFor [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; installerScriptForGHA = installScriptFor [ "x86_64-linux" "x86_64-darwin" ]; # Line coverage analysis. diff --git a/scripts/install.in b/scripts/install.in index f660e3807..39016d161 100755 --- a/scripts/install.in +++ b/scripts/install.in @@ -46,15 +46,9 @@ case "$(uname -s).$(uname -m)" in system=x86_64-darwin ;; Darwin.arm64|Darwin.aarch64) - # check for Rosetta 2 support - if ! [ -f /Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist ]; then - oops "Rosetta 2 is not installed on this ARM64 macOS machine. Run softwareupdate --install-rosetta then restart installation" - fi - - hash=@tarballHash_x86_64-darwin@ - path=@tarballPath_x86_64-darwin@ - # eventually maybe: aarch64-darwin - system=x86_64-darwin + hash=@binaryTarball_aarch64-darwin@ + path=@tarballPath_aarch64-darwin@ + system=aarch64-darwin ;; *) oops "sorry, there is no binary distribution of Nix for your platform";; esac