nixpkgs-suyu/pkgs/development/tools/doctl/default.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2016-07-19 12:30:35 +02:00
buildGoModule rec {
pname = "doctl";
2020-07-24 02:29:02 +02:00
version = "1.46.0";
2020-04-10 10:50:53 +02:00
vendorSha256 = null;
2016-07-19 12:30:35 +02:00
doCheck = false;
2020-04-10 10:50:53 +02:00
subPackages = [ "cmd/doctl" ];
buildFlagsArray = let t = "github.com/digitalocean/doctl"; in ''
2020-04-10 10:50:53 +02:00
-ldflags=
-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 10:50:53 +02:00
'';
2020-04-10 14:19:42 +02: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 14:19:42 +02:00
installShellCompletion doctl.$shell
done
'';
2016-07-19 12:30:35 +02:00
src = fetchFromGitHub {
2020-04-10 10:50:53 +02:00
owner = "digitalocean";
repo = "doctl";
rev = "v${version}";
2020-07-24 02:29:02 +02:00
sha256 = "1f9gw1qjannswx1vy64a5a2cfr8azsci241pk0xhrhk6aqpjzx1n";
2016-07-19 12:30:35 +02:00
};
2020-04-10 10:50:53 +02:00
meta = with lib; {
2016-07-19 12:30:35 +02:00
description = "A command line tool for DigitalOcean services";
2020-04-10 10:50:53 +02:00
homepage = "https://github.com/digitalocean/doctl";
license = licenses.asl20;
maintainers = [ maintainers.siddharthist ];
2016-07-19 12:30:35 +02:00
};
}