2018-11-19 20:03:44 +00:00
|
|
|
{ stdenv, lib, buildGoPackage, fetchFromGitHub, terraform, makeWrapper }:
|
2017-01-10 07:27:30 +00:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "terragrunt";
|
2020-02-05 18:29:09 +00:00
|
|
|
version = "0.21.11";
|
2017-01-10 07:27:30 +00:00
|
|
|
|
|
|
|
goPackagePath = "github.com/gruntwork-io/terragrunt";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gruntwork-io";
|
|
|
|
repo = "terragrunt";
|
2018-03-01 07:41:23 +00:00
|
|
|
rev = "v${version}";
|
2020-02-05 18:29:09 +00:00
|
|
|
sha256 = "1w64skk67i0sxjd2mkyqh3nglc32wc7schk7h8fwszpa1rw4dfcn";
|
2017-01-10 07:27:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
goDeps = ./deps.nix;
|
|
|
|
|
2017-02-03 02:55:24 +00:00
|
|
|
buildInputs = [ makeWrapper ];
|
2017-01-10 07:27:30 +00:00
|
|
|
|
2017-03-15 15:01:09 +00:00
|
|
|
preBuild = ''
|
2020-02-05 18:29:09 +00:00
|
|
|
find go/src -name vendor | xargs -I % sh -c 'echo Removing %; rm -rf %'
|
2017-03-15 15:01:09 +00:00
|
|
|
buildFlagsArray+=("-ldflags" "-X main.VERSION=v${version}")
|
|
|
|
'';
|
|
|
|
|
2017-01-10 07:27:30 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $bin/bin/terragrunt \
|
2018-11-19 20:03:44 +00:00
|
|
|
--set TERRAGRUNT_TFPATH ${lib.getBin terraform.full}/bin/terraform
|
2017-01-10 07:27:30 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A thin wrapper for Terraform that supports locking for Terraform state and enforces best practices.";
|
|
|
|
homepage = https://github.com/gruntwork-io/terragrunt/;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
|
|
};
|
|
|
|
}
|