Files
nixpkgs/pkgs/by-name/to/tofu-ls/package.nix
2026-06-05 14:55:56 +00:00

59 lines
1.4 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "tofu-ls";
version = "0.5.0";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "opentofu";
repo = "tofu-ls";
tag = "v${finalAttrs.version}";
hash = "sha256-v6oqCRsiTAOGqhVZD6Zwhq0/bSl55PhH9+aEYxjlQcA=";
};
vendorHash = "sha256-vugyEaOD7diOiymo9nDEfIez++mPYWq1qVj3a9wCqoc=";
ldflags = [
"-s"
];
checkFlags =
let
skippedTests = [
# Require network access
"TestCompletion_moduleWithValidData"
"TestCompletion_multipleModulesWithValidData"
"TestCompletion_multipleModulesWithValidData"
"TestExec_cancel"
"TestLangServer_DidChangeWatchedFiles_moduleInstalled"
"TestLangServer_workspace_symbol_basic"
"TestLangServer_workspace_symbol_missing"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
__darwinAllowLocalNetworking = true;
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "OpenTofu Language Server";
homepage = "https://github.com/opentofu/tofu-ls";
changelog = "https://github.com/opentofu/tofu-ls/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mpl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
mainProgram = "tofu-ls";
};
})