kamilchm / go2nix

Reproducible builds and development environment for Go
MIT License
93 stars 17 forks source link

go2nix probably can't be called in a builder because nix-prefetch-git wants access to the store #77

Open deliciouslytyped opened 5 years ago

deliciouslytyped commented 5 years ago

As far as I can tell, go2nix save only uses nix-prefetch-git to get a hash for some things: https://github.com/kamilchm/go2nix/blob/52270bd92cd689729097fb4326f5b53eea431cd6/hash.go#L16

It doesn't actually need the files to end up in the store? So it would be nice if it would just use nix-hash directly and that would mean it would be possible to run in a nix sandbox I think?

Edit: or be able to call nix-prefetch-git without needing to poke the store.

The actual error in question: Command /nix/store/8adaygqps8a6vivrwb2d5l57lz5gnxwr-nix-prefetch-git/bin/nix-prefetch-git [nix-prefetch-git --fetch-submodules file:///build/src/the.domain/go/some-project] failed: exit status 1

deliciouslytyped commented 5 years ago

https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchgit/nix-prefetch-git

deliciouslytyped commented 5 years ago

My script currently looks horrific but I can confirm that having patched the nix-store --add line out of nix-prefetch-git, this appears to work.