about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2017-03-31 12:19:22 +0100
committerzimbatm <zimbatm@zimbatm.com>2017-03-31 15:53:17 +0100
commit1afd3ceaaab5d11e17f47a473c6e6642aa074f18 (patch)
tree56e418a45074e213d6b8fe0e794accfc1cd026fb /pkgs/applications
parentc923c6c7c5ca947ed27f95749885b9f7871e9a0f (diff)
downloadnixlib-1afd3ceaaab5d11e17f47a473c6e6642aa074f18.tar
nixlib-1afd3ceaaab5d11e17f47a473c6e6642aa074f18.tar.gz
nixlib-1afd3ceaaab5d11e17f47a473c6e6642aa074f18.tar.bz2
nixlib-1afd3ceaaab5d11e17f47a473c6e6642aa074f18.tar.lz
nixlib-1afd3ceaaab5d11e17f47a473c6e6642aa074f18.tar.xz
nixlib-1afd3ceaaab5d11e17f47a473c6e6642aa074f18.tar.zst
nixlib-1afd3ceaaab5d11e17f47a473c6e6642aa074f18.zip
terraform: 0.9.1 -> 0.9.2
* makes the generic builder open for extension
* upgrades terraform and set the 0_9 series by default
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/cluster/terraform/default.nix94
1 files changed, 54 insertions, 40 deletions
diff --git a/pkgs/applications/networking/cluster/terraform/default.nix b/pkgs/applications/networking/cluster/terraform/default.nix
index ab0771656b59..42a8465bf8a3 100644
--- a/pkgs/applications/networking/cluster/terraform/default.nix
+++ b/pkgs/applications/networking/cluster/terraform/default.nix
@@ -1,43 +1,44 @@
-{ stdenv, lib, buildGoPackage, fetchFromGitHub }:
+{ stdenv, lib, buildGoPackage, fetchurl, fetchFromGitHub }:
 
 let
-  generic = { version, sha256 }:
-  buildGoPackage rec {
-    name = "terraform-${version}";
-
-    goPackagePath = "github.com/hashicorp/terraform";
-
-    src = fetchFromGitHub {
-      owner  = "hashicorp";
-      repo   = "terraform";
-      rev    = "v${version}";
-      inherit sha256;
-    };
-
-    postInstall = ''
-      # remove all plugins, they are part of the main binary now
-      for i in $bin/bin/*; do
-        if [[ $(basename $i) != terraform ]]; then
-          rm "$i"
-        fi
-      done
-    '';
-
-    preCheck = ''
-      export HOME=$TMP
-    '';
-
-    doCheck = builtins.compareVersions version "0.9.0" >= 0;
-
-    meta = with stdenv.lib; {
-      description = "Tool for building, changing, and versioning infrastructure";
-      homepage = https://www.terraform.io/;
-      license = licenses.mpl20;
-      maintainers = with maintainers; [ jgeerds zimbatm peterhoeg ];
-    };
-  };
+  goPackagePath = "github.com/hashicorp/terraform";
+
+  generic = { version, sha256, ... }@attrs:
+    let attrs' = builtins.removeAttrs attrs ["version" "sha256"]; in
+    buildGoPackage ({
+      name = "terraform-${version}";
+
+      inherit goPackagePath;
+
+      src = fetchFromGitHub {
+        owner  = "hashicorp";
+        repo   = "terraform";
+        rev    = "v${version}";
+        inherit sha256;
+      };
+
+      postInstall = ''
+        # remove all plugins, they are part of the main binary now
+        for i in $bin/bin/*; do
+          if [[ $(basename $i) != terraform ]]; then
+            rm "$i"
+          fi
+        done
+      '';
 
-in rec {
+      preCheck = ''
+        export HOME=$TMP
+      '';
+
+      meta = with stdenv.lib; {
+        description = "Tool for building, changing, and versioning infrastructure";
+        homepage = https://www.terraform.io/;
+        license = licenses.mpl20;
+        maintainers = with maintainers; [ jgeerds zimbatm peterhoeg ];
+      };
+    } // attrs');
+
+in {
   terraform_0_8_5 = generic {
     version = "0.8.5";
     sha256 = "1cxwv3652fpsbm2zk1akw356cd7w7vhny1623ighgbz9ha8gvg09";
@@ -48,8 +49,21 @@ in rec {
     sha256 = "0ibgpcpvz0bmn3cw60nzsabsrxrbmmym1hv7fx6zmjxiwd68w5gb";
   };
 
-  terraform_0_9_1 = generic {
-    version = "0.9.1";
-    sha256 = "081p6dlvkg9mgaz49ichxzlk1ks0rxa7nvilaq8jj1gq3jvylqnh";
+  terraform_0_9_2 = generic {
+    version = "0.9.2";
+    sha256 = "1yj5x1d10028fm3v3gjyjdn128ps0as345hr50y8x3vn86n70lxl";
+
+    patches = [
+      (fetchurl {
+        url = "https://github.com/hashicorp/terraform/pull/13237.patch";
+        sha256 = "1f7hr1l5hck9mmqk01p6wxbfv9r3b0yi9ypz7bcmikp3bikza98x";
+      })
+      (fetchurl {
+        url = "https://github.com/hashicorp/terraform/pull/13248.patch";
+        sha256 = "1qc57kjhlqg5339him9bg4izdphins2fjjhb4ffr7bv9lb5k0hkr";
+      })
+    ];
+
+    doCheck = true;
   };
 }