kamilchm / go2nix

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

Output flag to save separate generated nix for overridding in default.nix #10

Closed kamilchm closed 8 years ago

cstrahan commented 8 years ago

I think this is great step in the right direction, but I think there are still a few nits. When I wrap up work tonight, I'll have more constructive feedback, and might push up branch that's based 90% on this, plus a few changes.

cstrahan commented 8 years ago

Is there any reason not to use buildFromGitHub for go packages hosted on GitHub?

kamilchm commented 8 years ago

It was simple to start with fetch + vcs without any conditional branches. Using fetchFromGithub could be the next improvement after we find a base form for easy overridable derivations.

kamilchm commented 8 years ago

One more thought. Maybe we don't need any nix specific tool and we could use godep json from nix, eg.:

extraSrcs = stdenv.lib.importJSON ./Godeps/Godeps.json;

What do you think?

kamilchm commented 8 years ago

Wrong, godep doesn't produce checksums for dependencies :/

zimbatm commented 8 years ago

Is there any way to use intentional dependencies in the nix store ? I think that we can trust git commit ids to be unique.

kamilchm commented 8 years ago

You mean, searching dependencies in nix store and reuse it?

zimbatm commented 8 years ago

I mean if we could use the git sha key as the store key then we wouldn't have to calculate the checksum of the git folder. Right now it's a bit redundant to have both checksums if we trust git to always return the same data.

It looks like it's not implemented though: https://github.com/NixOS/nix/issues/296

kamilchm commented 8 years ago

buildGoPackage can use json files for dependencies like in https://github.com/NixOS/nixpkgs/blob/7d02cc1dd50766058b2ec2c6d3a741d96db5d27b/doc/languages-frameworks/go.xml and go2nix master supports this new format.