nixpkgs/pkgs/by-name/to/tofu-ls/package.nix
2025-07-10 11:17:00 +08:00

58 lines
1.4 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "tofu-ls";
version = "0.0.8";
src = fetchFromGitHub {
owner = "opentofu";
repo = "tofu-ls";
tag = "v${finalAttrs.version}";
hash = "sha256-zOdZjbzTfVM8Nu3cn2qJokC1gwvRVFEabOa2t9SI1AU=";
};
vendorHash = "sha256-CD3x52rHmxOfYZ++/C4xGi8aNzl4lS3Ev24sTcJe1FQ=";
ldflags = [
"-s"
"-w"
];
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;
versionCheckProgramArg = "--version";
passthru.updateScript = nix-update-script { };
meta = {
description = "OpenTofu Language Server";
homepage = "https://github.com/opentofu/tofu-ls";
license = lib.licenses.mpl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
mainProgram = "tofu-ls";
};
})