about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix b/nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix
new file mode 100644
index 000000000000..e189c563e86e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix
@@ -0,0 +1,46 @@
+{ lib, buildGoModule, fetchFromGitHub, stdenv }:
+
+buildGoModule rec {
+  pname = "terraform-ls";
+  version = "0.18.1";
+
+  src = fetchFromGitHub {
+    owner = "hashicorp";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-68Hs9kwv7GTGnYtoJh61ubaggPKbxFwz7qDwYaJ74c8=";
+  };
+  vendorSha256 = "sha256-NgOpnCe0uGQVDVKYUIULqPTfvfkDtxIUQiCVwiE7nuc=";
+
+  preBuild = ''
+    buildFlagsArray+=("-ldflags" "-s -w -X main.version=v${version} -X main.prerelease=")
+  '';
+
+  preCheck = ''
+    # Remove tests that requires networking
+    rm internal/terraform/exec/exec_test.go
+  '' + lib.optionalString stdenv.isAarch64 ''
+    # Not all test failures have tracking issues as HashiCorp do not have
+    # aarch64 testing infra easily available, see issue 549 below.
+
+    # Remove file that contains `TestLangServer_workspaceExecuteCommand_modules_multiple`
+    # which fails on aarch64: https://github.com/hashicorp/terraform-ls/issues/549
+    rm internal/langserver/handlers/execute_command_modules_test.go
+
+    # `TestModuleManager_ModuleCandidatesByPath` variants fail
+    rm internal/terraform/module/module_manager_test.go
+
+    # internal/terraform/module/module_ops_queue_test.go:17:15: undefined: testLogger
+    # internal/terraform/module/watcher_test.go:39:11: undefined: testLogger
+    # internal/terraform/module/watcher_test.go:79:14: undefined: testLogger
+    rm internal/terraform/module/{watcher_test,module_ops_queue_test}.go
+  '';
+
+  meta = with lib; {
+    description = "Terraform Language Server (official)";
+    homepage = "https://github.com/hashicorp/terraform-ls";
+    changelog = "https://github.com/hashicorp/terraform-ls/blob/v${version}/CHANGELOG.md";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ mbaillie jk ];
+  };
+}