summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/tfswitch
diff options
context:
space:
mode:
authorSibi Prabakaran <sibi@psibi.in>2021-07-05 22:52:17 +0530
committerSibi Prabakaran <sibi@psibi.in>2021-07-06 10:14:58 +0530
commit8feca53ba91565bcde27d36c35f3a6d3bc2c90db (patch)
tree628bb54b929fd7d36ecce6367705df7c1a67fa54 /pkgs/applications/networking/cluster/tfswitch
parenta00a31df2fe83ccf0a9fb6ab6934ff4e71dc0b37 (diff)
tfswitch: init at 0.12.1119
Add tfswitch which allows to easily manage different terraform
versions for different projects.
Diffstat (limited to 'pkgs/applications/networking/cluster/tfswitch')
-rw-r--r--pkgs/applications/networking/cluster/tfswitch/default.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/tfswitch/default.nix b/pkgs/applications/networking/cluster/tfswitch/default.nix
new file mode 100644
index 0000000000000..f56f8bc6d652c
--- /dev/null
+++ b/pkgs/applications/networking/cluster/tfswitch/default.nix
@@ -0,0 +1,32 @@
+{ buildGoModule, lib, fetchFromGitHub }:
+buildGoModule rec {
+  pname = "tfswitch";
+  version = "0.12.1119";
+
+  src = fetchFromGitHub {
+    owner = "warrensbox";
+    repo = "terraform-switcher";
+    rev = version;
+    sha256 = "1xsmr4hnmdg2il3rp39cyhv55ha4qcilcsr00iiija3bzxsm4rya";
+  };
+
+  vendorSha256 = "0mpm4m07v8w02g95cnj73m5gvd118id4ag2pym8d9r2svkyz5n70";
+
+  # Disable tests since it requires network access and relies on the
+  # presence of release.hashicorp.com
+  doCheck = false;
+
+  runVend = true;
+
+  postInstall = ''
+    # The binary is named tfswitch
+    mv $out/bin/terraform-switcher $out/bin/tfswitch
+  '';
+
+  meta = with lib; {
+    description = "A command line tool to switch between different versions of terraform";
+    homepage = "https://github.com/warrensbox/terraform-switcher";
+    license = licenses.mit;
+    maintainers = with maintainers; [ psibi ];
+  };
+}