@@ -0,0 +1,32 @@
1+{ buildGoModule, lib, fetchFromGitHub }:
2+buildGoModule rec {
3+ pname = "tfswitch";
4+ version = "0.12.1119";
5+
6+ src = fetchFromGitHub {
7+ owner = "warrensbox";
8+ repo = "terraform-switcher";
9+ rev = version;
10+ sha256 = "1xsmr4hnmdg2il3rp39cyhv55ha4qcilcsr00iiija3bzxsm4rya";
11+ };
12+
13+ vendorSha256 = "0mpm4m07v8w02g95cnj73m5gvd118id4ag2pym8d9r2svkyz5n70";
14+
15+ # Disable tests since it requires network access and relies on the
16+ # presence of release.hashicorp.com
17+ doCheck = false;
18+
19+ runVend = true;
20+
21+ postInstall = ''
22+ # The binary is named tfswitch
23+ mv $out/bin/terraform-switcher $out/bin/tfswitch
24+ '';
25+
26+ meta = with lib; {
27+ description = "A command line tool to switch between different versions of terraform";
28+ homepage = "https://github.com/warrensbox/terraform-switcher";
29+ license = licenses.mit;
30+ maintainers = with maintainers; [ psibi ];
31+ };
32+}