*: add config
This commit is contained in:
commit
80c42c7e45
22 changed files with 3229 additions and 0 deletions
39
derivations/dev/go.nix
Normal file
39
derivations/dev/go.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
pkgs ? import /home/steveej/src/github/NixOS/nixpkgs-systemsource {},
|
||||
name ? "generic",
|
||||
version,
|
||||
extraBuildInputs ? [] }:
|
||||
let
|
||||
goPackages = builtins.getAttr "go${version}Packages" pkgs;
|
||||
goBuildInputs = { goPackages }: [
|
||||
goPackages.go
|
||||
goPackages.tools
|
||||
goPackages.tools.bin
|
||||
goPackages.gocode
|
||||
goPackages.gocode.bin
|
||||
goPackages.godef
|
||||
goPackages.godef.bin
|
||||
goPackages.godep
|
||||
goPackages.godep.bin
|
||||
goPackages.gox.bin
|
||||
];
|
||||
goShellHook = { goPackages, name }: ''
|
||||
goname=${goPackages.go.version}_$name
|
||||
export GOROOT=${goPackages.go}/share/go
|
||||
export GOPATH="$HOME/.gopath_$goname"
|
||||
export PATH="$HOME/.gopath_$goname/bin:$PATH"
|
||||
unset name
|
||||
'';
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
inherit name;
|
||||
buildInputs = extraBuildInputs ++ (goBuildInputs){ inherit goPackages; };
|
||||
shellHook = (goShellHook) { inherit name; inherit goPackages; };
|
||||
# go14Env = mkGoEnv {
|
||||
# inherit name;
|
||||
# goPackages=pkgs.go14Packages;
|
||||
# };
|
||||
# go15 = mkGoEnv {
|
||||
# inherit name;
|
||||
# goPackages=pkgs.go15Packages;
|
||||
# };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue