infra/derivations/dev/go.nix

52 lines
1.2 KiB
Nix
Raw Normal View History

2016-11-17 00:09:52 +01:00
{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs {}
, pkgs ? gitpkgs
, name ? "generic"
, version
, extraBuildInputs ? []
, extraShellHook ? ""
}:
let
2016-06-28 11:39:21 -07:00
go = builtins.getAttr "go_${version}" pkgs;
2016-07-26 17:33:33 -07:00
buildInputs = with pkgs; [
glibc.out
glibc.static
2016-06-28 11:39:21 -07:00
go
gotools
#gotools.bin
2016-11-17 00:09:52 +01:00
#gocode.bin
2016-06-28 11:39:21 -07:00
#godef godef.bin
godep
#godep.bin
gox.bin
#ginkgo ginkgo.bin
#gomega
2016-11-17 00:09:52 +01:00
(import ./vim-go.nix{inherit pkgs;})
2016-11-17 00:09:52 +01:00
(import ./neovim-go.nix{inherit pkgs;})
2015-10-23 01:26:53 +02:00
];
2015-10-23 01:26:53 +02:00
in pkgs.stdenv.mkDerivation {
inherit name;
2016-07-26 17:33:33 -07:00
buildInputs = extraBuildInputs ++ buildInputs;
shellHook = ''
goname=${go.version}_$name
setPS1 $goname
export GOROOT=${go}/share/go
export GOPATH="$HOME/.gopath_$goname"
export PATH="$HOME/.gopath_$goname/bin:$PATH"
unset name
unset SSL_CERT_FILE
go get -u github.com/Masterminds/glide
go get -u github.com/sgotti/glide-vc
go get -u github.com/alecthomas/gometalinter
go get -u github.com/golang/lint/golint
go get -u github.com/rogpeppe/godef
go get -u github.com/kisielk/errcheck
go get -u github.com/jstemmer/gotags
go get -u github.com/klauspost/asmfmt/cmd/asmfmt
2016-11-17 00:09:52 +01:00
go get -u github.com/nsf/gocode
${extraShellHook}
'';
2015-10-23 01:26:53 +02:00
}