Holochain Forum

Setup on macbook with m1 chip

I am facing the following issue, while setting up holochain environment using nix-shell. Any help will be appreciated. Thanks

MacBook-Pro ~ % sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
. ~/.nix-profile/etc/profile.d/nix.sh
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use holochain-ci

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
100 2619 100 2619 0 0 6466 0 --:–:-- --:–:-- --:–:-- 6466
downloading Nix 2.3.15 binary tarball for aarch64-darwin from ‘https://releases.nixos.org/nix/nix-2.3.15/nix-2.3.15-aarch64-darwin.tar.xz’ to ‘/var/folders/d3/l71kyj4n2tx_2gvf6khfd6fr0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.ApErJqdQ’…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 19.9M 100 19.9M 0 0 8934k 0 0:00:02 0:00:02 --:–:-- 8934k
Note: a multi-user installation is possible. See https://nixos.org/nix/manual/#sect-multi-user-installation
Creating volume and mountpoint /nix.

| This installer will create a volume for the nix store and        |
| configure it to mount at /nix.  Follow these steps to uninstall. |
  1. Remove the entry from fstab using ‘sudo vifs’
  2. Destroy the data volume using ‘diskutil apfs deleteVolume’
  3. Remove the ‘nix’ line from /etc/synthetic.conf or the file

Using existing ‘Nix Store’ volume
performing a single-user installation of Nix…
copying Nix to /nix/store…
replacing old ‘nix-2.3.15’
installing ‘nix-2.3.15’
unpacking channels…

Installation finished! To ensure that the necessary environment
variables are set, either log in again, or type

. /Users/kamal/.nix-profile/etc/profile.d/nix.sh

in your shell.
replacing old ‘cachix-0.6.1’
installing ‘cachix-0.6.1’
Configured https://holochain-ci.cachix.org binary cache in /Users/kamal/.config/nix/nix.conf
MacBook-Pro ~ % cd developer-exercises

MacBook-Pro developer-exercises % nix-shell

error: Component resolution failed for rust-default-1.54.0

  • note: available extensions are cargo, clippy, clippy-preview, llvm-tools-preview, miri, miri-preview, reproducible-artifacts, rls, rls-preview, rust-analysis, rust-analyzer-preview, rust-docs, rust-mingw, rust-src, rust-std, rustc, rustc-dev, rustc-docs, rustfmt, rustfmt-preview
  • Host component rust-docs doesn’t support target aarch64-apple-darwin

@steveeJ any ideas? I’ve found https://github.com/rust-lang/rustup/issues/2692 but no idea if it would work.

Apple M1s are uncharted territory for me. i don’t posses one and don’t plan on changing that anytime soon. however, i searched around the webs and found that you can enable x86_64 mode on it using this command arch -x86_64 zsh. if you run that before installing nix and running the nix-shell it hopefully works as well as on x86_86 macOS. i’m curious if this does work so please let us know!

i know that @lucksus had access to such a machine so maybe he can share his experience as well.

1 Like