Skip to content

Commit

Permalink
terraform_0_14: init at 0.14.0 (NixOS#105746)
Browse files Browse the repository at this point in the history
  • Loading branch information
marsam committed Dec 3, 2020
1 parent 6cffa3e commit 209bdc8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
27 changes: 18 additions & 9 deletions pkgs/applications/networking/cluster/terraform/default.nix
@@ -1,15 +1,13 @@
{ stdenv, lib, buildEnv, buildGoPackage, fetchFromGitHub, makeWrapper, coreutils
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, coreutils
, runCommand, runtimeShell, writeText, terraform-providers, fetchpatch }:

let
goPackagePath = "github.com/hashicorp/terraform";

generic = { version, sha256, ... }@attrs:
let attrs' = builtins.removeAttrs attrs [ "version" "sha256" ];
in buildGoPackage ({
generic = { version, sha256, vendorSha256 ? null, ... }@attrs:
let attrs' = builtins.removeAttrs attrs [ "version" "sha256" "vendorSha256" ];
in buildGoModule ({
name = "terraform-${version}";

inherit goPackagePath;
inherit vendorSha256;

src = fetchFromGitHub {
owner = "hashicorp";
Expand All @@ -18,7 +16,7 @@ let
inherit sha256;
};

postPatch = ''
postConfigure = ''
# speakeasy hardcodes /bin/stty https://github.com/bgentry/speakeasy/issues/22
substituteInPlace vendor/github.com/bgentry/speakeasy/speakeasy_unix.go \
--replace "/bin/stty" "${coreutils}/bin/stty"
Expand All @@ -34,9 +32,12 @@ let
'';

preCheck = ''
export HOME=$TMP
export HOME=$TMPDIR
export TF_SKIP_REMOTE_TESTS=1
'';

subPackages = [ "." ];

meta = with stdenv.lib; {
description =
"Tool for building, changing, and versioning infrastructure";
Expand Down Expand Up @@ -163,6 +164,14 @@ in rec {
passthru = { inherit plugins; };
});

terraform_0_14 = pluggable (generic {
version = "0.14.0";
sha256 = "0pbglnvb6cx8zrz791lfa67dmjqfsyysbxm2083b1lhlmbybi9ax";
vendorSha256 = "1gxhdj98np482jm76aj6zbbmkn7vfk8b878hzz59iywgbdr1r4m1";
patches = [ ./provider-path.patch ];
passthru = { inherit plugins; };
});

# Tests that the plugins are being used. Terraform looks at the specific
# file pattern and if the plugin is not found it will try to download it
# from the Internet. With sandboxing enable this test will fail if that is
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -28139,6 +28139,7 @@ in
terraform_0_11-full
terraform_0_12
terraform_0_13
terraform_0_14
terraform_plugins_test
;

Expand Down

0 comments on commit 209bdc8

Please sign in to comment.