1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 installShellFiles,
6 qovery-cli,
7 testers,
8}:
9
10buildGoModule rec {
11 pname = "qovery-cli";
12 version = "1.2.6";
13
14 src = fetchFromGitHub {
15 owner = "Qovery";
16 repo = "qovery-cli";
17 tag = "v${version}";
18 hash = "sha256-NxrhZmRbkQNj2K4b6Em4cAdssJRdwEKbdGy8EThN4JY=";
19 };
20
21 vendorHash = "sha256-GKW89qzyuvwCUvN0i+LgU36Vtr5XuvgXIxwnMlGSTFg=";
22
23 nativeBuildInputs = [ installShellFiles ];
24
25 postInstall = ''
26 installShellCompletion --cmd ${pname} \
27 --bash <($out/bin/${pname} completion bash) \
28 --fish <($out/bin/${pname} completion fish) \
29 --zsh <($out/bin/${pname} completion zsh)
30 '';
31
32 passthru.tests.version = testers.testVersion {
33 package = qovery-cli;
34 command = "HOME=$(mktemp -d); ${pname} version";
35 };
36
37 meta = {
38 description = "Qovery Command Line Interface";
39 homepage = "https://github.com/Qovery/qovery-cli";
40 changelog = "https://github.com/Qovery/qovery-cli/releases/tag/v${version}";
41 license = with lib.licenses; [ asl20 ];
42 maintainers = with lib.maintainers; [ fab ];
43 mainProgram = "qovery-cli";
44 };
45}