diff --git a/pkgs/by-name/tf/tflint/package.nix b/pkgs/by-name/tf/tflint/package.nix index 45dc9d696097..0c164ffb3d5b 100644 --- a/pkgs/by-name/tf/tflint/package.nix +++ b/pkgs/by-name/tf/tflint/package.nix @@ -1,7 +1,8 @@ { lib, - buildGoModule, + buildGo125Module, fetchFromGitHub, + versionCheckHook, runCommand, makeWrapper, tflint, @@ -9,21 +10,18 @@ symlinkJoin, }: -let +buildGo125Module (finalAttrs: { pname = "tflint"; - version = "0.58.1"; -in -buildGoModule { - inherit pname version; + version = "0.59.1"; src = fetchFromGitHub { owner = "terraform-linters"; repo = "tflint"; - tag = "v${version}"; - hash = "sha256-1SuNcqU8JtMypoltbNBZHZZi78jvbbAD+nmj2v8NU5g="; + tag = "v${finalAttrs.version}"; + hash = "sha256-tE8h0sAKCJEZzZqUAcgyVWVRXdG3F7F1Vh7Je0+0Xeg="; }; - vendorHash = "sha256-8sHiCEtVs+rUnmJ9NPYJJcr4sDlFaEWklE3JaoXEu9w="; + vendorHash = "sha256-KVKxtH/Hgxe7We3K8ArovsRDPz6a2wEfQ8Zx3ScCo74="; doCheck = false; @@ -34,6 +32,12 @@ buildGoModule { "-w" ]; + doInstallCheck = true; + + nativeInstallCheckInputs = [ versionCheckHook ]; + + versionCheckProgramArg = "--version"; + passthru.withPlugins = plugins: let @@ -43,10 +47,10 @@ buildGoModule { paths = [ actualPlugins ]; }; in - runCommand "tflint-with-plugins-${version}" + runCommand "tflint-with-plugins-${finalAttrs.version}" { nativeBuildInputs = [ makeWrapper ]; - inherit version; + inherit (finalAttrs) version; } '' makeWrapper ${tflint}/bin/tflint $out/bin/tflint \ @@ -57,8 +61,8 @@ buildGoModule { description = "Terraform linter focused on possible errors, best practices, and so on"; mainProgram = "tflint"; homepage = "https://github.com/terraform-linters/tflint"; - changelog = "https://github.com/terraform-linters/tflint/blob/v${version}/CHANGELOG.md"; + changelog = "https://github.com/terraform-linters/tflint/blob/v${finalAttrs.version}/CHANGELOG.md"; license = lib.licenses.mpl20; maintainers = with lib.maintainers; [ momeemt ]; }; -} +})