From 0a7408c3d5a53ae341ba7980fbf440d0bbfff3a1 Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Tue, 9 Jan 2024 14:18:15 -0600 Subject: [PATCH] chore(flake.nix): install mockgen from source The stable package still points to the old repo. --- flake.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/flake.nix b/flake.nix index e7671015c79f2..45f2f6c3b136b 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,25 @@ # From https://nixos.wiki/wiki/Google_Cloud_SDK gdk = pkgs.google-cloud-sdk.withExtraComponents ([pkgs.google-cloud-sdk.components.gke-gcloud-auth-plugin]); + # Nixpkgs contains the old golang/mock library which is archived, but we + # use Uber's fork. An updated version exists in unstable, but hasn't + # made it to stable yet. + mockgen = pkgs.buildGoModule rec { + pname = "mockgen"; + version = "0.4.0"; + + src = pkgs.fetchFromGitHub { + owner = "uber-go"; + repo = "mock"; + rev = "v${version}"; + hash = "sha256-3nt70xrZisK5vgQa+STZPiY4F9ITKw8PbBWcKoBn4Vc="; + }; + + vendorHash = "sha256-mcNVud2jzvlPPQEaar/eYZkP71V2Civz+R5v10+tewA="; + + subPackages = [ "mockgen" ]; + }; + devShellPackages = with pkgs; [ bat cairo