2022-05-04 11:42:39 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2020-05-05 22:56:26 +01:00
|
|
|
|
2022-05-03 02:24:10 +01:00
|
|
|
buildGoModule rec {
|
2020-05-05 22:56:26 +01:00
|
|
|
pname = "exoscale-cli";
|
2022-12-03 04:51:53 +00:00
|
|
|
version = "1.61.0";
|
2020-05-05 22:56:26 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-05-03 02:24:10 +01:00
|
|
|
owner = "exoscale";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2022-12-03 04:51:53 +00:00
|
|
|
sha256 = "sha256-3ak/z6Ww+/VY1/TErQ+CBxq5xte3VeGbCz2P5QlHxLg=";
|
2020-05-05 22:56:26 +01:00
|
|
|
};
|
|
|
|
|
2022-05-03 02:24:10 +01:00
|
|
|
vendorSha256 = null;
|
2020-08-10 10:20:00 +01:00
|
|
|
|
2022-05-04 11:42:39 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-05-05 22:56:26 +01:00
|
|
|
|
2022-05-03 02:24:10 +01:00
|
|
|
ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}" ];
|
2020-05-05 22:56:26 +01: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-03 02:24:10 +01:00
|
|
|
mv $GOPATH/bin/cli $GOPATH/bin/exo
|
2022-05-04 11:42:39 +01:00
|
|
|
|
|
|
|
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-05 22:56:26 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Command-line tool for everything at Exoscale: compute, storage, dns";
|
2022-05-03 02:24:10 +01:00
|
|
|
homepage = "https://github.com/exoscale/cli";
|
|
|
|
license = lib.licenses.asl20;
|
2022-07-08 11:48:21 +01:00
|
|
|
maintainers = with lib.maintainers; [ viraptor ];
|
2022-04-01 20:34:55 +01:00
|
|
|
mainProgram = "exo";
|
2020-05-05 22:56:26 +01:00
|
|
|
};
|
|
|
|
}
|