From 0aaa27f0d20dff9c08e561f33431efa7dd120ede Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 19 Mar 2024 18:17:56 +0200 Subject: feat(third_party/nixpkgs): init cbtemulator This provides an emulator for Google Bigtable. This has also been sent to nixpkgs in https://github.com/NixOS/nixpkgs/pull/298044, and can be dropped (modulo the patches) once we bump past it. Change-Id: Id7809a02065ce479d6d29813d1de454cd230d2df Reviewed-on: https://cl.tvl.fyi/c/depot/+/11211 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster --- third_party/overlays/tvl.nix | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'third_party') diff --git a/third_party/overlays/tvl.nix b/third_party/overlays/tvl.nix index 83b1fcf63e..fd68aea55d 100644 --- a/third_party/overlays/tvl.nix +++ b/third_party/overlays/tvl.nix @@ -83,6 +83,49 @@ depot.nix.readTree.drvTargets { }; })); + # Upstreamed in https://github.com/NixOS/nixpkgs/pull/298044, + # can be reduced to just the patch on the next nixpkgs bump. + cbtemulator = super.buildGoModule rec { + pname = "cbtemulator"; + version = "1.22.0"; + + src = (super.fetchFromGitHub { + owner = "googleapis"; + repo = "google-cloud-go"; + rev = "bigtable/v${version}"; + hash = "sha256-eOi4QFthnmZb5ry/5L7wzr4Fy1pF/H07BzxOnXtmSu4="; + }) + "/bigtable"; + + vendorHash = "sha256-7M7YZfl0usjN9hLGozqJV2bGh+M1ec4PZRGYUhEckpY="; + subPackages = [ "cmd/emulator" ]; + + patches = [ + (super.fetchpatch { + url = "https://github.com/googleapis/google-cloud-go/pull/9665/commits/7b716627fae4d8b28f175eff968090d27d4477eb.patch"; + hash = "sha256-nEVB7DjafByGHspfDYPcCRHMVHBjeSQ5MBVd6eeo4ls="; + stripLen = 1; + }) + (super.fetchpatch { + url = "https://github.com/googleapis/google-cloud-go/pull/9665/commits/a65bc68f49bd340040f836e890f1fd4d781f6f2a.patch"; + hash = "sha256-Zu1JXym+IK9pWp7HKJiGUv2HG776hUat8Qlty9/PsQs="; + stripLen = 1; + }) + ]; + + postInstall = '' + mv $out/bin/emulator $out/bin/cbtemulator + ''; + + meta = with lib; { + description = "In-memory Google Cloud Bigtable server"; + homepage = "https://github.com/googleapis/google-cloud-go/blob/bigtable/v1.22.0/bigtable/cmd/emulator/cbtemulator.go"; + license = licenses.asl20; + maintainers = [ maintainers.flokli ]; + mainProgram = "cbtemulator"; + platforms = platforms.all; + }; + }; + crate2nix = super.rustPlatform.buildRustPackage rec { pname = "crate2nix"; version = "0.13.0"; -- cgit 1.4.1