From 5280effa98ac07eae7d3ded1197d65c1a6608ff2 Mon Sep 17 00:00:00 2001 From: Mutsuha Asada Date: Mon, 23 Sep 2024 11:38:01 +0900 Subject: [PATCH 1/2] tflint: modernized derivation and formatted via nixfmt-rfc-style - Removed `rec` - Removed `with lib;` - Formatted via nixfmt-rfc-style --- .../tools/analysis/tflint/default.nix | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/pkgs/development/tools/analysis/tflint/default.nix b/pkgs/development/tools/analysis/tflint/default.nix index c3a7b65b051d..5ec4650a11a6 100644 --- a/pkgs/development/tools/analysis/tflint/default.nix +++ b/pkgs/development/tools/analysis/tflint/default.nix @@ -1,21 +1,25 @@ -{ lib -, buildGoModule -, fetchFromGitHub -, runCommand -, makeWrapper -, tflint -, tflint-plugins -, symlinkJoin +{ + lib, + buildGoModule, + fetchFromGitHub, + runCommand, + makeWrapper, + tflint, + tflint-plugins, + symlinkJoin, }: -buildGoModule rec { +let pname = "tflint"; version = "0.52.0"; +in +buildGoModule { + inherit pname version; src = fetchFromGitHub { owner = "terraform-linters"; repo = pname; - rev = "v${version}"; + rev = "refs/tags/v${version}"; hash = "sha256-H27krznCX00F0EZ4ahdsMVh+wcAAUC/ErQac9Y4QaJs="; }; @@ -25,9 +29,13 @@ buildGoModule rec { subPackages = [ "." ]; - ldflags = [ "-s" "-w" ]; + ldflags = [ + "-s" + "-w" + ]; - passthru.withPlugins = plugins: + passthru.withPlugins = + plugins: let actualPlugins = plugins tflint-plugins; pluginDir = symlinkJoin { @@ -38,17 +46,18 @@ buildGoModule rec { runCommand "tflint-with-plugins" { nativeBuildInputs = [ makeWrapper ]; - } '' - makeWrapper ${tflint}/bin/tflint $out/bin/tflint \ - --set TFLINT_PLUGIN_DIR "${pluginDir}" - ''; + } + '' + makeWrapper ${tflint}/bin/tflint $out/bin/tflint \ + --set TFLINT_PLUGIN_DIR "${pluginDir}" + ''; - meta = with lib; { + meta = { 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"; - license = licenses.mpl20; - maintainers = [ ]; + license = lib.licenses.mpl20; + maintainers = with lib.maintainers; [ momeemt ]; }; } From 373cbc318a4156578e70d1b6135c6f3cb772d696 Mon Sep 17 00:00:00 2001 From: Mutsuha Asada Date: Mon, 23 Sep 2024 11:39:28 +0900 Subject: [PATCH 2/2] tflint: moved to by-name --- .../tflint/default.nix => by-name/tf/tflint/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{development/tools/analysis/tflint/default.nix => by-name/tf/tflint/package.nix} (100%) diff --git a/pkgs/development/tools/analysis/tflint/default.nix b/pkgs/by-name/tf/tflint/package.nix similarity index 100% rename from pkgs/development/tools/analysis/tflint/default.nix rename to pkgs/by-name/tf/tflint/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 587c69d8ed05..bb6433d72512 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18803,8 +18803,6 @@ with pkgs; time-ghc-modules = callPackage ../development/tools/time-ghc-modules { }; - tflint = callPackage ../development/tools/analysis/tflint { }; - tflint-plugins = recurseIntoAttrs ( callPackage ../development/tools/analysis/tflint-plugins { } );