# Pastebin gC4WXFVT projects = (fromJSON ( readFile "${goDeps}/Gopkg.json" )).projects; projectSources = map (project: pkgs.stdenv.mkDerivation { name = replaceStrings ["/"] ["-"] project.name; src = fetchGit { url = (if ( hasPrefix "golang.org" project.name ) then "https://go.googlesource.com/" + ( elemAt (splitString "/" project.name) 2 ) else "https://" + project.name); rev = project.revision; } // (if project?branch then { ref = project.branch; } else {}); phases = "buildPhase"; buildPhase = '' mkdir -p $out/package cp -r $src/* $out/package echo "${project.name}" > $out/name ''; } ) projects; goDeps = pkgs.stdenv.mkDerivation { name = "goDeps"; src = ./Gopkg.lock; phases = "buildPhase"; buildInputs = [ pkgs.remarshal ]; buildPhase = '' mkdir -p $out; remarshal --indent-json -if toml -i $src -of json -o $out/Gopkg.json ''; };