nixpkgs/pkgs/tools/admin/exoscale-cli/default.nix

34 lines
926 B
Nix
Raw Normal View History

2022-05-03 01:24:10 +00:00
{ lib, buildGoModule, fetchFromGitHub }:
2020-05-05 21:56:26 +00:00
2022-05-03 01:24:10 +00:00
buildGoModule rec {
2020-05-05 21:56:26 +00:00
pname = "exoscale-cli";
2022-05-03 01:24:10 +00:00
version = "1.54.0";
2020-05-05 21:56:26 +00:00
src = fetchFromGitHub {
2022-05-03 01:24:10 +00:00
owner = "exoscale";
repo = "cli";
rev = "v${version}";
sha256 = "sha256-uvPJ1cOKMpDf1KfEPkSTWMIMNojUlfpqI1ESomX1MlM=";
2020-05-05 21:56:26 +00:00
};
2022-05-03 01:24:10 +00:00
vendorSha256 = null;
2020-08-10 09:20:00 +00:00
2022-05-03 01:24:10 +00:00
excludedPackages = [ "./completion" "./docs" ];
2020-05-05 21:56:26 +00:00
2022-05-03 01:24:10 +00:00
ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}" ];
2020-05-05 21:56:26 +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-03 01:24:10 +00:00
mv $GOPATH/bin/cli $GOPATH/bin/exo
2020-05-05 21:56:26 +00:00
'';
meta = {
description = "Command-line tool for everything at Exoscale: compute, storage, dns";
2022-05-03 01:24:10 +00:00
homepage = "https://github.com/exoscale/cli";
license = lib.licenses.asl20;
2021-01-15 09:19:50 +00:00
maintainers = with lib.maintainers; [ dramaturg ];
mainProgram = "exo";
2020-05-05 21:56:26 +00:00
};
}