Skip to content

Commit 94e7097

Browse files
authored
tflint: moved to by-name and modernized derivation (#343856)
2 parents 12b2c13 + 373cbc3 commit 94e7097

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed
Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
{ lib
2-
, buildGoModule
3-
, fetchFromGitHub
4-
, runCommand
5-
, makeWrapper
6-
, tflint
7-
, tflint-plugins
8-
, symlinkJoin
1+
{
2+
lib,
3+
buildGoModule,
4+
fetchFromGitHub,
5+
runCommand,
6+
makeWrapper,
7+
tflint,
8+
tflint-plugins,
9+
symlinkJoin,
910
}:
1011

11-
buildGoModule rec {
12+
let
1213
pname = "tflint";
1314
version = "0.52.0";
15+
in
16+
buildGoModule {
17+
inherit pname version;
1418

1519
src = fetchFromGitHub {
1620
owner = "terraform-linters";
1721
repo = pname;
18-
rev = "v${version}";
22+
rev = "refs/tags/v${version}";
1923
hash = "sha256-H27krznCX00F0EZ4ahdsMVh+wcAAUC/ErQac9Y4QaJs=";
2024
};
2125

@@ -25,9 +29,13 @@ buildGoModule rec {
2529

2630
subPackages = [ "." ];
2731

28-
ldflags = [ "-s" "-w" ];
32+
ldflags = [
33+
"-s"
34+
"-w"
35+
];
2936

30-
passthru.withPlugins = plugins:
37+
passthru.withPlugins =
38+
plugins:
3139
let
3240
actualPlugins = plugins tflint-plugins;
3341
pluginDir = symlinkJoin {
@@ -38,17 +46,18 @@ buildGoModule rec {
3846
runCommand "tflint-with-plugins"
3947
{
4048
nativeBuildInputs = [ makeWrapper ];
41-
} ''
42-
makeWrapper ${tflint}/bin/tflint $out/bin/tflint \
43-
--set TFLINT_PLUGIN_DIR "${pluginDir}"
44-
'';
49+
}
50+
''
51+
makeWrapper ${tflint}/bin/tflint $out/bin/tflint \
52+
--set TFLINT_PLUGIN_DIR "${pluginDir}"
53+
'';
4554

46-
meta = with lib; {
55+
meta = {
4756
description = "Terraform linter focused on possible errors, best practices, and so on";
4857
mainProgram = "tflint";
4958
homepage = "https://github.com/terraform-linters/tflint";
5059
changelog = "https://github.com/terraform-linters/tflint/blob/v${version}/CHANGELOG.md";
51-
license = licenses.mpl20;
52-
maintainers = [ ];
60+
license = lib.licenses.mpl20;
61+
maintainers = with lib.maintainers; [ momeemt ];
5362
};
5463
}

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18556,8 +18556,6 @@ with pkgs;
1855618556

1855718557
time-ghc-modules = callPackage ../development/tools/time-ghc-modules { };
1855818558

18559-
tflint = callPackage ../development/tools/analysis/tflint { };
18560-
1856118559
tflint-plugins = recurseIntoAttrs (
1856218560
callPackage ../development/tools/analysis/tflint-plugins { }
1856318561
);

0 commit comments

Comments
 (0)