2024-09-19 14:19:46 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib, cf-terraforming, testers, installShellFiles, stdenv }:
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "cf-terraforming";
|
2024-10-09 16:51:18 +00:00
|
|
|
version = "0.21.0";
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cloudflare";
|
|
|
|
repo = "cf-terraforming";
|
|
|
|
rev = "v${version}";
|
2024-10-09 16:51:18 +00:00
|
|
|
sha256 = "sha256-fJ3TgdEv9vk5HUUG+0cqYuA4fjXq5Smjf/KAILT9/AU=";
|
2022-09-22 12:36:57 +00:00
|
|
|
};
|
|
|
|
|
2024-10-09 16:51:18 +00:00
|
|
|
vendorHash = "sha256-NNeJ6QfTV8X3WIFge+Ln38ym9uagLl3IpNWuPqMjeBA=";
|
2022-09-22 12:36:57 +00:00
|
|
|
ldflags = [ "-X github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.versionString=${version}" ];
|
|
|
|
|
|
|
|
# The test suite insists on downloading a binary release of Terraform from
|
|
|
|
# Hashicorp at runtime, which isn't going to work in a nix build
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
passthru.tests = testers.testVersion {
|
|
|
|
package = cf-terraforming;
|
|
|
|
command = "cf-terraforming version";
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform)''
|
|
|
|
installShellCompletion --cmd cf-terraforming \
|
|
|
|
--bash <($out/bin/cf-terraforming completion bash) \
|
|
|
|
--fish <($out/bin/cf-terraforming completion fish) \
|
|
|
|
--zsh <($out/bin/cf-terraforming completion zsh)
|
|
|
|
'';
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Command line utility to facilitate terraforming your existing Cloudflare resources";
|
2022-09-22 12:36:57 +00:00
|
|
|
homepage = "https://github.com/cloudflare/cf-terraforming/";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ benley ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "cf-terraforming";
|
2022-09-22 12:36:57 +00:00
|
|
|
};
|
|
|
|
}
|