diff options
-rw-r--r-- | pkgs/development/tools/analysis/tflint/default.nix | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/pkgs/development/tools/analysis/tflint/default.nix b/pkgs/development/tools/analysis/tflint/default.nix index 1eab36cf78d..1011cacd366 100644 --- a/pkgs/development/tools/analysis/tflint/default.nix +++ b/pkgs/development/tools/analysis/tflint/default.nix @@ -1,4 +1,12 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib +, buildGoModule +, fetchFromGitHub +, runCommand +, makeWrapper +, tflint +, tflint-plugins +, symlinkJoin +}: buildGoModule rec { pname = "tflint"; @@ -19,6 +27,22 @@ buildGoModule rec { ldflags = [ "-s" "-w" ]; + 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}" + ''; + meta = with lib; { description = "Terraform linter focused on possible errors, best practices, and so on"; homepage = "https://github.com/terraform-linters/tflint"; |