46 lines
1.3 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "tflint-ruleset-google";
version = "0.34.0";
src = fetchFromGitHub {
owner = "terraform-linters";
repo = pname;
rev = "v${version}";
hash = "sha256-rbV7eNQAN4RjhsIUfxIFCPdcAAehuWv5iGwCxEFKhsU=";
};
vendorHash = "sha256-cDKcBbyF7iizJ9j5qAMME7WlsP1UJ7Ti9W1hzA3XfV0=";
# upstream Makefile also does a go test $(go list ./... | grep -v integration)
preCheck = ''
rm integration/integration_test.go
'';
subPackages = [ "." ];
postInstall = ''
# allow use as a versioned dependency, i.e., with `source = ...` and
# `version = ...` in `.tflintrc`:
mkdir -p $out/github.com/terraform-linters/${pname}/${version}
mv $out/bin/${pname} $out/github.com/terraform-linters/${pname}/${version}/
# allow use as an unversioned dependency, e.g., if one wants `.tflintrc` to
# solely rely on Nix to pin versions:
ln -s $out/github.com/terraform-linters/${pname}/${version}/${pname} $out/
'';
meta = with lib; {
homepage = "https://github.com/terraform-linters/tflint-ruleset-google";
description = "TFLint ruleset plugin for Terraform Google Provider";
platforms = platforms.unix;
maintainers = with maintainers; [ john-rodewald ];
license = with licenses; [ mpl20 ];
};
}