amazon-q-cli: add versionCheckHook

This commit is contained in:
Pol Dellaiera 2025-05-06 10:43:49 +02:00
parent 33bac1c2cc
commit 57c566abdc

View file

@ -3,6 +3,7 @@
fetchFromGitHub,
rustPlatform,
protobuf_26,
versionCheckHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
@ -24,6 +25,15 @@ rustPlatform.buildRustPackage (finalAttrs: {
"-p"
"q_cli"
];
nativeBuildInputs = [
protobuf_26
];
postInstall = ''
install -m 0755 $out/bin/q_cli $out/bin/amazon-q
'';
cargoTestFlags = [
"-p"
"q_cli"
@ -52,13 +62,10 @@ rustPlatform.buildRustPackage (finalAttrs: {
"--skip=init_lint_zsh_pre_zshrc"
];
nativeBuildInputs = [
protobuf_26
];
postInstall = ''
install -m 0755 $out/bin/q_cli $out/bin/amazon-q
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/amazon-q";
versionCheckProgramArg = "--version";
meta = {
description = "Amazon Q Developer AI coding agent CLI";