mongodb-tools: extracted from goPackages

This commit is contained in:
Kamil Chmielewski
2016-06-09 11:21:30 +02:00
parent 89a256e463
commit 387246080b
5 changed files with 88 additions and 22 deletions
+39
View File
@@ -0,0 +1,39 @@
# This file was generated by go2nix.
{ stdenv, lib, goPackages, fetchgit, fetchhg, fetchbzr, fetchsvn }:
with goPackages;
let
tools = [
"bsondump" "mongodump" "mongoexport" "mongofiles" "mongoimport"
"mongooplog" "mongorestore" "mongostat" "mongotop"
];
in
buildGoPackage rec {
name = "mongo-tools-${version}";
version = "3.0.12";
rev = "r${version}";
goPackagePath = "github.com/mongodb/mongo-tools";
subPackages = map (t: t + "/main") tools;
src = fetchgit {
inherit rev;
url = "https://github.com/mongodb/mongo-tools";
sha256 = "142vxgniri1mfy2xmfgxhbdp6k6h8c5milv454krv1b51v43hsbm";
};
goDeps = ./deps.json;
# Mongodb incorrectly names all of their binaries main
# Let's work around this with our own installer
preInstall = ''
mkdir -p $bin/bin
'' + toString (map (t: ''
go install $goPackagePath/${t}/main
mv go/bin/main $bin/bin/${t}
''
) tools) + ''
rm -r go/bin
'';
}
+12
View File
@@ -0,0 +1,12 @@
[
{
"include": "../../../go-modules/libs.json",
"packages": [
"github.com/howeyc/gopass",
"github.com/jessevdk/go-flags",
"golang.org/x/crypto",
"gopkg.in/mgo.v2",
"gopkg.in/tomb.v2"
]
}
]