DeterminateSystems / zero-to-nix

Zero to Nix is your guide to learning Nix and flakes. Created by Determinate Systems.

Home Page:https://zero-to-nix.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot build zero to nix on apple silicon M2

jmandel1027 opened this issue Β· 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.