b55a4ee46f
GitOrigin-RevId: e9158eca70ae59e73fae23be5d13d3fa0cfc78b4
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "doctl";
|
|
version = "1.54.0";
|
|
|
|
vendorSha256 = null;
|
|
|
|
doCheck = false;
|
|
|
|
subPackages = [ "cmd/doctl" ];
|
|
|
|
buildFlagsArray = let t = "github.com/digitalocean/doctl"; in ''
|
|
-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
|
|
'';
|
|
|
|
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
|
|
installShellCompletion doctl.$shell
|
|
done
|
|
'';
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "digitalocean";
|
|
repo = "doctl";
|
|
rev = "v${version}";
|
|
sha256 = "163n3d07vv9d4356ql6hbw2vg6n5c834axz7y4gk8gm9badbna82";
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "A command line tool for DigitalOcean services";
|
|
homepage = "https://github.com/digitalocean/doctl";
|
|
license = licenses.asl20;
|
|
maintainers = [ maintainers.siddharthist ];
|
|
};
|
|
}
|