Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

68 lines
1.3 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
openssl,
pkg-config,
libpcap,
nix-update-script,
}:
buildGoModule rec {
pname = "mongo-tools";
version = "100.13.0";
src = fetchFromGitHub {
owner = "mongodb";
repo = "mongo-tools";
tag = version;
hash = "sha256-aQrwJFFdaCIkcnofdGtZ/BMX9KPqr1pHxwm+A04LhXI=";
};
vendorHash = null;
nativeBuildInputs = [ pkg-config ];
buildInputs = [
openssl
libpcap
];
# Mongodb incorrectly names all of their binaries main
# Let's work around this with our own installer
buildPhase =
let
tools = [
"bsondump"
"mongodump"
"mongoexport"
"mongofiles"
"mongoimport"
"mongorestore"
"mongostat"
"mongotop"
];
in
''
# move vendored codes so nixpkgs go builder could find it
runHook preBuild
${lib.concatMapStrings (t: ''
go build -o "$out/bin/${t}" -tags ssl -ldflags "-s -w" ./${t}/main
'') tools}
runHook postBuild
'';
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/mongodb/mongo-tools";
description = "Tools for the MongoDB";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
bryanasdev000
iamanaws
];
};
}