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";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "0.43.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "terraform-linters";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
sha256 = "sha256-a5rTG+4qObdmInVZH8QkMdWmRrDA9ZUl2NL5p53D2MY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
vendorSha256 = "sha256-hdevIQ0Ugn7+MtvNbF+HjJAMyBtGYuJPCFFcxS8p35E=";
|
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";
|
|
|
|
homepage = "https://github.com/terraform-linters/tflint";
|
2021-06-06 07:54:09 +00:00
|
|
|
changelog = "https://github.com/terraform-linters/tflint/raw/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
}
|