1 { buildGoModule, fetchFromGitHub, lib, cf-terraforming, testers, installShellFiles, stdenv }:
4 pname = "cf-terraforming";
7 src = fetchFromGitHub {
9 repo = "cf-terraforming";
11 sha256 = "sha256-fJ3TgdEv9vk5HUUG+0cqYuA4fjXq5Smjf/KAILT9/AU=";
14 vendorHash = "sha256-NNeJ6QfTV8X3WIFge+Ln38ym9uagLl3IpNWuPqMjeBA=";
15 ldflags = [ "-X github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.versionString=${version}" ];
17 # The test suite insists on downloading a binary release of Terraform from
18 # Hashicorp at runtime, which isn't going to work in a nix build
21 passthru.tests = testers.testVersion {
22 package = cf-terraforming;
23 command = "cf-terraforming version";
26 nativeBuildInputs = [ installShellFiles ];
28 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform)''
29 installShellCompletion --cmd cf-terraforming \
30 --bash <($out/bin/cf-terraforming completion bash) \
31 --fish <($out/bin/cf-terraforming completion fish) \
32 --zsh <($out/bin/cf-terraforming completion zsh)
36 description = "Command line utility to facilitate terraforming your existing Cloudflare resources";
37 homepage = "https://github.com/cloudflare/cf-terraforming/";
38 license = licenses.mpl20;
39 maintainers = with maintainers; [ benley ];
40 mainProgram = "cf-terraforming";