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