Based on PR #4222 , also ported ngrok, didn't test it but the binaries run. cc @iElectric are you fine with this kind of build?
@ehmry I've added $makeFlags to go install call, maybe improper but it's ok for now I think. Also added go13Packages and go14Packages. Removed the crypto package, confirming it's broken with recent go versions.
Build with nix-build -A ngrok.
nix-build -A ngrok
Packages to port:
new Go support function 'buildGoPackage'
add a setupHook to the Go compiler that builds a GOPATH
new buildGoPackage function that overides the phases of stdenv
buildGoPackage: add $makeFlags to go install call
Looks good. Might wanna delete old ngrok expression.
I can't say I think go.crypto is very well maintained, so its not a supprise to me.
@ehmry as a result I've also dropped cjdcmd, sorry. At a later attempt maybe :)
Thats ok, it was a test.
Port ngrok to buildGoPackage
Drop cjdcmd because of broken go crypto
Also cc @cstrahan , retained as maintainer. I've decided to keep ngrok in its own directory instead of under goPackages. Now working on porting the other software.
Nice, the last thing we would need is go2nix fixed for a new format.
@offlinehacker what should go2nix do? I personally don't want packages to be auto updated.
Port golint to buildGoPackage
Port gotags to buildGoPackage
Port pond to buildGoPackage
Just ported pond, which required crypto. So @ehmry it seems to work, it's a different hash though, but at least compiles with go 1.3 :)
Port gocode to buildGoPackage
Fix and port bosun and scollector to buildGoPackage
Port gox to buildGoPackage
Port etcdctl to buildGoPackage
Port go-repo-root to buildGoPackage
Port etcd to buildGoPackage
nix-generate-go-package: new utility to generate expressions
@lethalman I'll check it out.
I also think that auto-updating packages would be trouble, but a tool to generate the package expressions would be very useful.
I had a quick and dirty shell script to do that but I don't know how it compares to go2nix.
Port serfdom to buildGoPackage
I'm resolving conflicts between package names using the repo name. E.g. rcrowley.go-metrics and armon.go-metrics.
@ehmry indeed giving a repo path and automatically creating the nix expression is handy. I just don't like the way npm packages are updated, for example.
Port go-mtpfs to buildGoPackage
cc @bennofs ported go-mtpfs, hope it's ok for you :)
Port flannel to buildGoPackage
Port nsq to buildGoPackage
Port influxdb-backup to buildGoPackage
So packer uses gox, and consul also uses ruby in the build. I would leave them as is for now.
Port syncthing to buildGoPackage
Use buildFlags in buildGoPackage instead of makeFlags
Also I wouldn't touch kubernetes either.
@matejc I've ported syncthing to buildGoPackage, does it look fine to you?
@lethalman no problem, as long as it works :)
Ok so I'm going to merge this in a few days, I will do a quick test of all the packages again. That said, if a ported package doesn't work we can always bring the older version back.
Also I think I'm going to add a flag, like dontInstallSrc to avoid installing the src for packages where it makes sense to only ship executables.
Add dontInstallSrc flag to buildGoPackage
OK let's merge this and see :)
@lethalman I think this is worthy of mentioning in https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/release-notes/rl-unstable.xml
I'm using $ nix-build -A packer|&grep "cannot find package" | sed -E 's/cannot find package "(.*)" in any of:/\1/'| cut -d " " -f 2|sort|uniq to get a list of buildInputs
$ nix-build -A packer|&grep "cannot find package" | sed -E 's/cannot find package "(.*)" in any of:/\1/'| cut -d " " -f 2|sort|uniq