nixpkgs/pkgs/by-name/cf/cf-terraforming/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

43 lines
1.5 KiB
Nix

{ buildGoModule, fetchFromGitHub, lib, cf-terraforming, testers, installShellFiles, stdenv }:
buildGoModule rec {
pname = "cf-terraforming";
version = "0.21.0";
src = fetchFromGitHub {
owner = "cloudflare";
repo = "cf-terraforming";
rev = "v${version}";
sha256 = "sha256-fJ3TgdEv9vk5HUUG+0cqYuA4fjXq5Smjf/KAILT9/AU=";
};
vendorHash = "sha256-NNeJ6QfTV8X3WIFge+Ln38ym9uagLl3IpNWuPqMjeBA=";
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";
};
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)
'';
meta = with lib; {
description = "Command line utility to facilitate terraforming your existing Cloudflare resources";
homepage = "https://github.com/cloudflare/cf-terraforming/";
license = licenses.mpl20;
maintainers = with maintainers; [ benley ];
mainProgram = "cf-terraforming";
};
}