Closed bphenriques closed 2 years ago
Also use pkgs.stdenv.hostPlatform.isAarch64
to check
How to override some packages:
x86-packages = final: prev: (optionalAttrs (prev.stdenv.system == "aarch64-darwin") {
inherit (final.pkgs-x86);
# google-cloud-sdk
# ngrok;
});
apple-silicon = final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") {
# Add access to x86 packages system is running Apple Silicon
pkgs-x86 = import inputs.nixpkgs-unstable {
system = "x86_64-darwin";
inherit (nixpkgsConfig) config;
};
};
Not sure if this is actually needed:
nix.extraOptions = ''
auto-optimise-store = true
experimental-features = nix-command flakes
'' + lib.optionalString (pkgs.system == "aarch64-darwin") ''
extra-platforms = x86_64-darwin aarch64-darwin
'';
Reason: I think I saw a PR/commit where the extra-platforms
is set automatically on nix-darwin.
This might be needed to setup Rosetta on macos:
$ /usr/sbin/softwareupdate --install-rosetta --agree-to-license
CPU=$(uname -p)
if [[ "$CPU" == "arm" ]]; then
eval $(/opt/homebrew/bin/brew shellenv)
else
eval $(/opt/homebrew/bin/brew shellenv)
eval $(/usr/local/bin/brew shellenv)
fi
Had to manually remove IntelliJ and Docker from Homebrew.
Most likely need to review if some packages can now be fetched from
nixpkgs
and not from Homebrew.