opentofu-ls: add versionCheckHook

This commit is contained in:
CnTeng
2025-06-10 23:11:05 +08:00
parent 697ed78054
commit 0dbfd62ea5
+7
View File
@@ -2,6 +2,7 @@
lib,
buildGoModule,
fetchFromGitHub,
versionCheckHook,
unstableGitUpdater,
}:
@@ -21,6 +22,7 @@ buildGoModule (finalAttrs: {
ldflags = [
"-s"
"-w"
"-X 'main.rawVersion=${finalAttrs.version}'"
];
checkFlags =
@@ -40,6 +42,11 @@ buildGoModule (finalAttrs: {
__darwinAllowLocalNetworking = true;
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/tofu-ls";
versionCheckProgramArg = "--version";
passthru = {
updateScript = unstableGitUpdater { };
};