nixpkgs/pkgs/by-name/qo/qovery-cli/package.nix
2026-06-26 14:26:06 +00:00

59 lines
1.5 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
versionCheckHook,
writableTmpDirAsHomeHook,
}:
buildGoModule (finalAttrs: {
pname = "qovery-cli";
version = "1.166.0";
src = fetchFromGitHub {
owner = "Qovery";
repo = "qovery-cli";
tag = "v${finalAttrs.version}";
hash = "sha256-orNVII6Y82YVtgEKpQnEpNXVWsg6P3sHluW1FGU20DA=";
};
vendorHash = "sha256-fZqzHJa5VFC1z5ZaHCXNyIKbwLjb3pSEb9FHs4YhWZg=";
env.CGO_ENABLED = 0;
ldflags = [ "-X github.com/qovery/qovery-cli/utils.Version=v${finalAttrs.version}" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd qovery-cli \
--bash <($out/bin/qovery-cli completion bash) \
--fish <($out/bin/qovery-cli completion fish) \
--zsh <($out/bin/qovery-cli completion zsh)
'';
# need network
doCheck = false;
doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
writableTmpDirAsHomeHook
];
versionCheckKeepEnvironment = [ "HOME" ];
versionCheckProgramArg = "version";
meta = {
description = "Qovery Command Line Interface";
homepage = "https://github.com/Qovery/qovery-cli";
changelog = "https://github.com/Qovery/qovery-cli/releases/tag/v${finalAttrs.version}";
license = with lib.licenses; [ asl20 ];
maintainers = with lib.maintainers; [ fab ];
mainProgram = "qovery-cli";
};
})