2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, runCommand
|
|
|
|
, makeWrapper
|
|
|
|
, tflint
|
|
|
|
, tflint-plugins
|
|
|
|
, symlinkJoin
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "tflint";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.52.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "terraform-linters";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-H27krznCX00F0EZ4ahdsMVh+wcAAUC/ErQac9Y4QaJs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
vendorHash = "sha256-jTwzheC/BtcuLGwtLanOccbidOPCHmqxJ4Mwhsid6jY=";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
passthru.withPlugins = plugins:
|
|
|
|
let
|
|
|
|
actualPlugins = plugins tflint-plugins;
|
|
|
|
pluginDir = symlinkJoin {
|
|
|
|
name = "tflint-plugin-dir";
|
|
|
|
paths = [ actualPlugins ];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
runCommand "tflint-with-plugins"
|
|
|
|
{
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
} ''
|
|
|
|
makeWrapper ${tflint}/bin/tflint $out/bin/tflint \
|
|
|
|
--set TFLINT_PLUGIN_DIR "${pluginDir}"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Terraform linter focused on possible errors, best practices, and so on";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "tflint";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/terraform-linters/tflint";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/terraform-linters/tflint/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mpl20;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
}
|