From a7f9b63b5d48784474f1ba9669b14be92f51c15a Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 18 Oct 2022 10:50:22 +0200 Subject: [PATCH] tflint-plugins, tflint-plugins.tflint-ruleset-aws: init at 0.17.1 --- .../tools/analysis/tflint-plugins/default.nix | 3 ++ .../tflint-plugins/tflint-ruleset-aws.nix | 38 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 3 files changed, 45 insertions(+) create mode 100644 pkgs/development/tools/analysis/tflint-plugins/default.nix create mode 100644 pkgs/development/tools/analysis/tflint-plugins/tflint-ruleset-aws.nix diff --git a/pkgs/development/tools/analysis/tflint-plugins/default.nix b/pkgs/development/tools/analysis/tflint-plugins/default.nix new file mode 100644 index 000000000000..409d7d1e4684 --- /dev/null +++ b/pkgs/development/tools/analysis/tflint-plugins/default.nix @@ -0,0 +1,3 @@ +{ callPackage, ... }: { + tflint-ruleset-aws = callPackage ./tflint-ruleset-aws.nix { }; +} diff --git a/pkgs/development/tools/analysis/tflint-plugins/tflint-ruleset-aws.nix b/pkgs/development/tools/analysis/tflint-plugins/tflint-ruleset-aws.nix new file mode 100644 index 000000000000..a3c28a0a9bc0 --- /dev/null +++ b/pkgs/development/tools/analysis/tflint-plugins/tflint-ruleset-aws.nix @@ -0,0 +1,38 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "tflint-ruleset-aws"; + version = "0.17.1"; + + src = fetchFromGitHub { + owner = "terraform-linters"; + repo = pname; + rev = "v${version}"; + hash = "sha256-2Qr+tG1cmDF9MdsLMOnIdSGWMVAYYVgobE/SuJZRqJg="; + }; + + vendorHash = "sha256-P3yqDqVoC6XCX5OJ8kTvIk6Qq8X02Be51TajIkZxdbI="; + + # upstream Makefile also does a go test $(go list ./... | grep -v integration) + preCheck = '' + rm integration/integration_test.go + ''; + + postInstall = '' + mkdir -p $out/github.com/terraform-linters/${pname}/${version} + mv $out/bin/${pname} $out/github.com/terraform-linters/${pname}/${version}/ + # remove other binaries from bin + rm -R $out/bin + ''; + + meta = with lib; { + homepage = "https://github.com/terraform-linters/tflint-ruleset-aws"; + description = "TFLint ruleset plugin for Terraform AWS Provider"; + platforms = platforms.unix; + maintainers = with maintainers; [ flokli ]; + license = with licenses; [ mpl20 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b4a518f5a3dc..be43e291e113 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17630,6 +17630,10 @@ with pkgs; tflint = callPackage ../development/tools/analysis/tflint { }; + tflint-plugins = recurseIntoAttrs ( + callPackage ../development/tools/analysis/tflint-plugins { } + ); + tfsec = callPackage ../development/tools/analysis/tfsec { }; todoist = callPackage ../applications/misc/todoist { };