59 lines
1.4 KiB
Nix
59 lines
1.4 KiB
Nix
{
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
lib,
|
|
tenv,
|
|
testers,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "tenv";
|
|
version = "3.2.10";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "tofuutils";
|
|
repo = "tenv";
|
|
rev = "v${version}";
|
|
hash = "sha256-EiWajXUQTK8xJoehpq+LWdjy84+lB7oilFM1v59F/30=";
|
|
};
|
|
|
|
vendorHash = "sha256-YC6LCrrxw9gZMc/ow628lL9KbePM8RhiAjLZ7HG2FY8=";
|
|
|
|
# Tests disabled for requiring network access to release.hashicorp.com
|
|
doCheck = false;
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X main.version=v${version}"
|
|
];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
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
|
|
];
|
|
};
|
|
}
|