nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, buildGoModule, fetchFromGitHub, stdenv }:
2
3buildGoModule rec {
4 pname = "terraform-ls";
5 version = "0.30.1";
6
7 src = fetchFromGitHub {
8 owner = "hashicorp";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-enPnj4/p83hQkVv821MGyGipgEmVo12IZzy/3y8UprQ=";
12 };
13 vendorSha256 = "sha256-U3zslBDVz5nvhNgcn5L84hSUolf7XFCuh7zMZxyW/gQ=";
14
15 ldflags = [ "-s" "-w" "-X main.version=v${version}" "-X main.prerelease=" ];
16
17 # There's a mixture of tests that use networking and several that fail on aarch64
18 doCheck = false;
19
20 doInstallCheck = true;
21 installCheckPhase = ''
22 runHook preInstallCheck
23 $out/bin/terraform-ls --help
24 $out/bin/terraform-ls version | grep "v${version}"
25 runHook postInstallCheck
26 '';
27
28 meta = with lib; {
29 description = "Terraform Language Server (official)";
30 homepage = "https://github.com/hashicorp/terraform-ls";
31 changelog = "https://github.com/hashicorp/terraform-ls/blob/v${version}/CHANGELOG.md";
32 license = licenses.mpl20;
33 maintainers = with maintainers; [ mbaillie jk ];
34 };
35}