2022-05-18 14:49:53 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
buildGoModule rec {
|
2020-05-15 21:57:56 +00:00
|
|
|
pname = "exoscale-cli";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.77.2";
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-05-18 14:49:53 +00:00
|
|
|
owner = "exoscale";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-hVuQBdmVBEwioNYHPUneF5Ink12Lh5cdS7UU2hd6SXs=";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
vendorHash = null;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}" ];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
|
|
# we need to rename the resulting binary but can't use buildFlags with -o here
|
|
|
|
# because these are passed to "go install" which does not recognize -o
|
|
|
|
postBuild = ''
|
2022-05-18 14:49:53 +00:00
|
|
|
mv $GOPATH/bin/cli $GOPATH/bin/exo
|
|
|
|
|
|
|
|
mkdir -p manpage
|
|
|
|
$GOPATH/bin/docs --man-page
|
|
|
|
rm $GOPATH/bin/docs
|
|
|
|
|
|
|
|
$GOPATH/bin/completion bash
|
|
|
|
$GOPATH/bin/completion zsh
|
|
|
|
rm $GOPATH/bin/completion
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installManPage manpage/*
|
|
|
|
installShellCompletion --cmd exo --bash bash_completion --zsh zsh_completion
|
2020-05-15 21:57:56 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Command-line tool for everything at Exoscale: compute, storage, dns";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://github.com/exoscale/cli";
|
|
|
|
license = lib.licenses.asl20;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with lib.maintainers; [ viraptor ];
|
2022-04-27 09:35:20 +00:00
|
|
|
mainProgram = "exo";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
}
|