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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2020-05-05 23:56:26 +02:00
2022-05-03 03:24:10 +02:00
buildGoModule rec {
2020-05-05 23:56:26 +02:00
pname = "exoscale-cli";
2022-09-02 15:50:59 +02:00
version = "1.59.1";
2020-05-05 23:56:26 +02:00
src = fetchFromGitHub {
2022-05-03 03:24:10 +02:00
owner = "exoscale";
repo = "cli";
rev = "v${version}";
2022-09-02 15:50:59 +02:00
sha256 = "sha256-dkiUO68NtWU/GOOuJvihlOfnEjF+5sNSkOAttCrQEHI=";
2020-05-05 23:56:26 +02:00
};
2022-05-03 03:24:10 +02:00
vendorSha256 = null;
2020-08-10 11:20:00 +02:00
nativeBuildInputs = [ installShellFiles ];
2020-05-05 23:56:26 +02:00
2022-05-03 03:24:10 +02:00
ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}" ];
2020-05-05 23:56:26 +02: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 03:24:10 +02: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-05 23:56:26 +02:00
'';
meta = {
description = "Command-line tool for everything at Exoscale: compute, storage, dns";
2022-05-03 03:24:10 +02:00
homepage = "https://github.com/exoscale/cli";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ viraptor ];
mainProgram = "exo";
2020-05-05 23:56:26 +02:00
};
}