2020-05-29 06:06:01 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "doctl";
|
2020-11-12 09:05:59 +00:00
|
|
|
version = "1.51.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
vendorSha256 = null;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
subPackages = [ "cmd/doctl" ];
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
buildFlagsArray = let t = "github.com/digitalocean/doctl"; in ''
|
2020-04-24 23:36:52 +00:00
|
|
|
-ldflags=
|
2020-05-29 06:06:01 +00:00
|
|
|
-X ${t}.Major=${lib.versions.major version}
|
|
|
|
-X ${t}.Minor=${lib.versions.minor version}
|
|
|
|
-X ${t}.Patch=${lib.versions.patch version}
|
|
|
|
-X ${t}.Label=release
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
export HOME=$(mktemp -d) # attempts to write to /homeless-shelter
|
|
|
|
for shell in bash fish zsh; do
|
2020-05-15 21:57:56 +00:00
|
|
|
$out/bin/doctl completion $shell > doctl.$shell
|
2020-04-24 23:36:52 +00:00
|
|
|
installShellCompletion doctl.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "digitalocean";
|
|
|
|
repo = "doctl";
|
|
|
|
rev = "v${version}";
|
2020-11-12 09:05:59 +00:00
|
|
|
sha256 = "1pc1nyzjzgnwchxbhgwiq46rysxpvxv7nmshvmphqm7avxfsmdzf";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A command line tool for DigitalOcean services";
|
|
|
|
homepage = "https://github.com/digitalocean/doctl";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.siddharthist ];
|
|
|
|
};
|
|
|
|
}
|