From a4ba55ef2ae014f37c3594edd2b320d31061f435 Mon Sep 17 00:00:00 2001 From: ryota2357 Date: Mon, 24 Nov 2025 21:14:12 +0900 Subject: [PATCH] ghalint: init at 1.5.3 --- pkgs/by-name/gh/ghalint/package.nix | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pkgs/by-name/gh/ghalint/package.nix diff --git a/pkgs/by-name/gh/ghalint/package.nix b/pkgs/by-name/gh/ghalint/package.nix new file mode 100644 index 000000000000..d03de74a3625 --- /dev/null +++ b/pkgs/by-name/gh/ghalint/package.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenv, + buildGoModule, + fetchFromGitHub, + installShellFiles, + versionCheckHook, +}: + +buildGoModule (finalAttrs: { + pname = "ghalint"; + version = "1.5.3"; + + src = fetchFromGitHub { + owner = "suzuki-shunsuke"; + repo = "ghalint"; + tag = "v${finalAttrs.version}"; + hash = "sha256-zll71vSqSKIij/TUi4LnGtVqmLhK9UViFDkpnuEvmz8="; + }; + + vendorHash = "sha256-pCrVBgS7eLCYlfY6FyAGAeEhpV2dYQowtE/BoRUju0o="; + + subPackages = [ "cmd/ghalint" ]; + + env.CGO_ENABLED = 0; + + ldflags = [ + "-s" + "-w" + "-X main.version=${finalAttrs.version}" + "-X main.commit=v${finalAttrs.version}" + ]; + + nativeBuildInputs = [ + installShellFiles + ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd 'ghalint' \ + --bash <("$out/bin/ghalint" completion bash) \ + --zsh <("$out/bin/ghalint" completion zsh) \ + --fish <("$out/bin/ghalint" completion fish) + ''; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + versionCheckProgramArg = "version"; + + meta = { + homepage = "https://github.com/suzuki-shunsuke/ghalint"; + description = "GitHub Actions linter for security best practice"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ryota2357 ]; + mainProgram = "ghalint"; + }; +})