2022-11-02 22:02:43 +00:00
|
|
|
{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, buildPackages }:
|
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";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.95.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
vendorHash = 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" ];
|
|
|
|
|
2021-08-06 21:57:35 +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"
|
|
|
|
];
|
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
|
2022-11-02 22:02:43 +00:00
|
|
|
${stdenv.hostPlatform.emulator buildPackages} $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}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-gRkReaRDbFGDty8AjuXwoBPEF2wnXMcWVSFaUDideQs=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|