3 ms·
What I did on my M1 was: 1. Grab a pre-release of Nix 2.4 from the `binaryTarball.aarch64-darwin` job on Hydra: https://hydra.nixos.org/jobset/nix/master#tabs-
by callahad 5y ago
What I did on my M1 was:
1. Grab a pre-release of Nix 2.4 from the `binaryTarball.aarch64-darwin` job on Hydra: https://hydra.nixos.org/jobset/nix/master#tabs-jobs https://hydra.nixos.org/jobset/nix/master#tabs-jobs
2. Run the installer with: ./install --daemon --no-channel-add
3. Edit `/etc/nix/nix.conf` to include the line: experimental-features = nix-command flakes ca-references
4. Restart the daemon with: sudo launchctl kickstart -k system/org.nixos.nix-daemon
5. Done!
At this point you have a Nix installation, without any legacy channels, which uses aarch64-darwin by default. If you have Rosetta2 installed, Nix will automatically detect it and set `extra-platforms = x86_64-darwin` so you can seamlessly use / build software for other architectures. If you want to specifically get an Intel version of something in nixpkgs, you have to explicitly state it like: `nixpkgs#legacyPackages.x86_64-darwin.foo`
I found Alexander Bantyev's blog post, "Practical Nix Flakes" (https://serokell.io/blog/practical-nix-flakes https://serokell.io/blog/practical-nix-flakes) especially helpful in figuring out how things are intended to work, followed by the unstable branch of the Nix documentation at https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix.html https://nixos.org/manual/nix/unstable/command-ref/new-cli/ni..., which covers the new CLI commands.