cannot build zero to nix on apple silicon M2
jmandel1027 opened this issue ยท 4 comments
Hi there! I wanted to learn more about Nix after reading your Buildkite blog post! I work at Square and run buildkite things there, the setup you described was super impressive!
I recently got a brand new M2 Mac from work, installed the determinate nix installer and was following along here: when I got this error:
error: flake 'github:DeterminateSystems/zero-to-nix' does not provide attribute 'packages.aarch64-darwin.go-dev', 'legacyPackages.aarch64-darwin.go-dev' or 'go-dev'
I also tried this:
nix build github:DeterminateSystems/zero-to-nix#go-dev
error: flake 'github:DeterminateSystems/zero-to-nix' does not provide attribute 'packages.aarch64-darwin.go-dev', 'legacyPackages.aarch64-darwin.go-dev' or 'go-dev'
seems like there's a missing key. Thanks in advance!
Oh wait, i think something funky happened when i copied the commands into the shell. False alarm ๐๐๐
The issue here is that go-dev
is actually a template and not a flake output. So instead, you need to initialize the template and go from there, as laid out here.
At any time, you can see what a flake outputs using nix flake show
:
nix flake show "https://flakehub.com/f/DeterminateSystems/zero-to-nix/*"
In this case, you can see that go-dev
is a template ๐
thank you! yeah something strange happened when i dropped the template in the project i was tinkering with, the project got zipped into the results
folder, it was a little weird for a second. and when I realized what was up i nuked it, tried again and worked like a charm!
FYI, result
is actually a symlink to the built artifact in the Nix store.