Skip to content

Instantly share code, notes, and snippets.

@kendricktan
Last active December 18, 2021 23:34
Show Gist options
  • Save kendricktan/8463eb9561f30c521fcb10c4c2c95709 to your computer and use it in GitHub Desktop.
Save kendricktan/8463eb9561f30c521fcb10c4c2c95709 to your computer and use it in GitHub Desktop.
dapptools macos
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
# if PATH does *not* contain `~/.nix-profile/bin`
if [ -n "${PATH##*.nix-profile/bin*}" ]; then
# If this flag is set, `nix-daemon.sh` returns early
# https://issueexplorer.com/issue/NixOS/nix/5298
unset __ETC_PROFILE_NIX_SOURCED
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
fi
# End Nix
https://dapphub.chat/channel/dev?msg=qoH9H3ffEbXKHt7HS
ok, so I made it work by forcing everything to run as x64_64 under rosetta.
@mariano.conti I had to do the following from a completely fresh installation:
1. install nix: `sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon`
2. install rosetta: `/usr/sbin/softwareupdate --install-rosetta --agree-to-license`
3. add `system = x86_64-darwin` to `/etc/nix/nix.conf`
4. add my user as a trusted user by adding the following to `/etc/nix/nix.conf`: `trusted-users = root <MY_USERNAME>`
5. run the dapptools installer: `curl https://dapp.tools/install | sh`
but this is a pretty hacky workaround and presumably will make everything slower since we're going through the x86_64 emulation layer
longer term I think we need to wait for ghc-8.10.5 to land in nixpkgs (which adds support for m1 macs), this is currently in pr: https://github.com/NixOS/nixpkgs/pull/126195
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment