3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/doctl/default.nix

44 lines
1.1 KiB
Nix
Raw Normal View History

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