2020-05-15 20:12:50 -07:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2016-07-19 03:30:35 -07:00
|
|
|
|
2020-05-15 20:12:50 -07:00
|
|
|
buildGoModule rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "doctl";
|
2020-11-25 18:02:27 -08:00
|
|
|
version = "1.53.0";
|
2020-04-10 01:50:53 -07:00
|
|
|
|
2020-05-15 20:12:50 -07:00
|
|
|
vendorSha256 = null;
|
2016-07-19 03:30:35 -07:00
|
|
|
|
2020-08-03 17:26:27 -07:00
|
|
|
doCheck = false;
|
|
|
|
|
2020-04-10 01:50:53 -07:00
|
|
|
subPackages = [ "cmd/doctl" ];
|
|
|
|
|
2020-05-15 20:12:50 -07:00
|
|
|
buildFlagsArray = let t = "github.com/digitalocean/doctl"; in ''
|
2020-04-10 01:50:53 -07:00
|
|
|
-ldflags=
|
2020-05-15 20:12:50 -07: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-10 01:50:53 -07:00
|
|
|
'';
|
2016-11-17 14:32:21 -08:00
|
|
|
|
2020-04-10 05:19:42 -07:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
export HOME=$(mktemp -d) # attempts to write to /homeless-shelter
|
|
|
|
for shell in bash fish zsh; do
|
2020-04-27 18:50:57 -07:00
|
|
|
$out/bin/doctl completion $shell > doctl.$shell
|
2020-04-10 05:19:42 -07:00
|
|
|
installShellCompletion doctl.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2016-07-19 03:30:35 -07:00
|
|
|
src = fetchFromGitHub {
|
2020-04-10 01:50:53 -07:00
|
|
|
owner = "digitalocean";
|
|
|
|
repo = "doctl";
|
|
|
|
rev = "v${version}";
|
2020-11-25 18:02:27 -08:00
|
|
|
sha256 = "1zw6gdmy1jlwi7rrbdxg7pkiq54ha0h1gmzphn3mflfk7lmgyikm";
|
2016-07-19 03:30:35 -07:00
|
|
|
};
|
|
|
|
|
2020-04-10 01:50:53 -07:00
|
|
|
meta = with lib; {
|
2016-07-19 03:30:35 -07:00
|
|
|
description = "A command line tool for DigitalOcean services";
|
2020-04-10 01:50:53 -07:00
|
|
|
homepage = "https://github.com/digitalocean/doctl";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.siddharthist ];
|
2016-07-19 03:30:35 -07:00
|
|
|
};
|
|
|
|
}
|