depot/third_party/nixpkgs/pkgs/by-name/te/tenv/package.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

46 lines
1.3 KiB
Nix

{ buildGoModule, fetchFromGitHub, installShellFiles, lib, tenv, testers }:
buildGoModule rec {
pname = "tenv";
version = "1.11.6";
src = fetchFromGitHub {
owner = "tofuutils";
repo = "tenv";
rev = "v${version}";
hash = "sha256-k7IKzklqGP676xd6ptIfbPLqAxUwaBZUz1dZ88pJReU=";
};
vendorHash = "sha256-OrMCzqqOFQkI8IwcfO/JVPyd/sw+Ud0VySV7UPiucwc=";
# Tests disabled for requiring network access to release.hashicorp.com
doCheck = false;
ldflags = [
"-s" "-w"
"-X main.version=v${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd tenv \
--zsh <($out/bin/tenv completion zsh) \
--bash <($out/bin/tenv completion bash) \
--fish <($out/bin/tenv completion fish)
'';
passthru.tests.version = testers.testVersion {
command = "HOME=$TMPDIR tenv --version";
package = tenv;
version = "v${version}";
};
meta = {
changelog = "https://github.com/tofuutils/tenv/releases/tag/v${version}";
description = "OpenTofu, Terraform, Terragrunt and Atmos version manager written in Go";
homepage = "https://tofuutils.github.io/tenv";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ rmgpinto nmishin kvendingoldo ];
};
}