1 { lib, buildGoModule, fetchFromGitHub, installShellFiles }:
4 pname = "exoscale-cli";
7 src = fetchFromGitHub {
11 sha256 = "sha256-hVuQBdmVBEwioNYHPUneF5Ink12Lh5cdS7UU2hd6SXs=";
16 nativeBuildInputs = [ installShellFiles ];
18 ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}" ];
20 # we need to rename the resulting binary but can't use buildFlags with -o here
21 # because these are passed to "go install" which does not recognize -o
23 mv $GOPATH/bin/cli $GOPATH/bin/exo
26 $GOPATH/bin/docs --man-page
29 $GOPATH/bin/completion bash
30 $GOPATH/bin/completion zsh
31 rm $GOPATH/bin/completion
35 installManPage manpage/*
36 installShellCompletion --cmd exo --bash bash_completion --zsh zsh_completion
40 description = "Command-line tool for everything at Exoscale: compute, storage, dns";
41 homepage = "https://github.com/exoscale/cli";
42 license = lib.licenses.asl20;
43 maintainers = with lib.maintainers; [ viraptor ];