DeterminateSystems/zero-to-nix

Golang flake example in guide 4 fails to build

rome-user opened this issue · 2 comments

I am following the exact instructions. The following error appears in the terminal.

% mkdir nix-go-pkg && cd nix-go-pkg
% nix flake init --template "github:DeterminateSystems/zero-to-nix#go-pkg"
...
% nix build
error: hash mismatch in fixed-output derivation '/nix/store/55diq4szqziz1va15k79m4vqq0hqfbf6-zero-to-nix-go-go-modules.drv':
         specified: sha256-pYnN8rxXNNLRegvJySwAyMUPBmnhSiDSHfMQpjB9Qjs=
            got:    sha256-26t5XhDl9TWHGdYuzxzkuM1NMvEp7XUlRr3BeCiJFgA=
error: 1 dependencies of derivation '/nix/store/cr1rzpjg6i9pf20dr0zqpzr3gn6l8y4h-zero-to-nix-go.drv' failed to build

I am not sure if this is good practice, but replacing the hash in the flake.nix with the expected value fixes the build on my end. Maybe the guide can elaborate on this?

The same issue in the javascript flake

error: hash mismatch in fixed-output derivation '/nix/store/6dpr18z8sinm87qbk0d515q9nfzpsmkj-zero-to-nix-javascript-npm-deps.drv':
         specified: sha256-8Bj7nPZBAU+SnVTeKeArcjYnfZV4z/4I7fX+l0V+v04=
            got:    sha256-A/q4C8Ox1InaJ/320+pU9uBUv6zqTKlzzOmJUvzBOnI=
error: 1 dependencies of derivation '/nix/store/89fjyx59sgmllbylygj9bn99sx0pfz26-zero-to-nix-javascript.drv' failed to build