diff --git a/pkgs/by-name/ta/talhelper/package.nix b/pkgs/by-name/ta/talhelper/package.nix new file mode 100644 index 000000000000..8b5bce45bb76 --- /dev/null +++ b/pkgs/by-name/ta/talhelper/package.nix @@ -0,0 +1,60 @@ +{ + buildGoModule, + fetchFromGitHub, + installShellFiles, + lib, + stdenv, + versionCheckHook, +}: + +buildGoModule (finalAttrs: { + pname = "talhelper"; + version = "3.0.28"; + + src = fetchFromGitHub { + owner = "budimanjojo"; + repo = "talhelper"; + tag = "v${finalAttrs.version}"; + hash = "sha256-ZAzj0KMGtm0817zKur088fAoYDMcnrlDXY+DjP5PIVY="; + }; + + vendorHash = "sha256-5cuOUGoSuuc5Ro1XVQGgW+flp3rqaXNhDewzeErq4k0="; + + ldflags = [ + "-s" + "-w" + "-X github.com/budimanjojo/talhelper/v3/cmd.version=v${finalAttrs.version}" + ]; + + subPackages = [ + "." + "./cmd" + ]; + + nativeBuildInputs = [ installShellFiles ]; + + doInstallCheck = true; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd talhelper \ + --bash <($out/bin/talhelper completion bash) \ + --fish <($out/bin/talhelper completion fish) \ + --zsh <($out/bin/talhelper completion zsh) + ''; + + meta = { + changelog = "https://github.com/budimanjojo/talhelper/releases/tag/v${finalAttrs.version}"; + description = "Help creating Talos kubernetes cluster"; + longDescription = '' + Talhelper is a helper tool to help creating Talos Linux cluster + in your GitOps repository. + ''; + homepage = "https://github.com/budimanjojo/talhelper"; + mainProgram = "talhelper"; + maintainers = with lib.maintainers; [ madeddie ]; + license = lib.licenses.bsd3; + }; +})