hoarder: 0.21.0 -> 0.22.0
[NixPkgs.git] / pkgs / by-name / cf / cf-terraforming / package.nix
blobc2900ad8353145a6c92d4639d7a8883cb8b521ba
2   buildGoModule,
3   fetchFromGitHub,
4   lib,
5   cf-terraforming,
6   testers,
7   installShellFiles,
8   stdenv,
9 }:
11 buildGoModule rec {
12   pname = "cf-terraforming";
13   version = "0.23.2";
15   src = fetchFromGitHub {
16     owner = "cloudflare";
17     repo = "cf-terraforming";
18     rev = "v${version}";
19     sha256 = "sha256-y98UXRC8pyCIhCUHh9vqxXkN+HDwSTfplOAJZwKnIxw=";
20   };
22   vendorHash = "sha256-tSN+ExQeDlaw8kTnDGIGbdAoX5wCPhp9MgYi2Z8fGvc=";
23   ldflags = [
24     "-X github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.versionString=${version}"
25   ];
27   # The test suite insists on downloading a binary release of Terraform from
28   # Hashicorp at runtime, which isn't going to work in a nix build
29   doCheck = false;
31   passthru.tests = testers.testVersion {
32     package = cf-terraforming;
33     command = "cf-terraforming version";
34   };
36   nativeBuildInputs = [ installShellFiles ];
38   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
39     installShellCompletion --cmd cf-terraforming \
40       --bash <($out/bin/cf-terraforming completion bash) \
41       --fish <($out/bin/cf-terraforming completion fish) \
42       --zsh <($out/bin/cf-terraforming completion zsh)
43   '';
45   meta = with lib; {
46     description = "Command line utility to facilitate terraforming your existing Cloudflare resources";
47     homepage = "https://github.com/cloudflare/cf-terraforming/";
48     license = licenses.mpl20;
49     maintainers = with maintainers; [ benley ];
50     mainProgram = "cf-terraforming";
51   };