1 { stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, buildPackages }:
11 subPackages = [ "cmd/doctl" ];
13 ldflags = let t = "github.com/digitalocean/doctl"; in [
14 "-X ${t}.Major=${lib.versions.major version}"
15 "-X ${t}.Minor=${lib.versions.minor version}"
16 "-X ${t}.Patch=${lib.versions.patch version}"
17 "-X ${t}.Label=release"
20 nativeBuildInputs = [ installShellFiles ];
23 export HOME=$(mktemp -d) # attempts to write to /homeless-shelter
24 for shell in bash fish zsh; do
25 ${stdenv.hostPlatform.emulator buildPackages} $out/bin/doctl completion $shell > doctl.$shell
26 installShellCompletion doctl.$shell
30 src = fetchFromGitHub {
31 owner = "digitalocean";
34 sha256 = "sha256-b7pks3a2ApR32tc06HZ9hG2MoZKVoWwCBATtcV1+WBo=";
38 description = "A command line tool for DigitalOcean services";
39 mainProgram = "doctl";
40 homepage = "https://github.com/digitalocean/doctl";
41 license = licenses.asl20;
42 maintainers = [ maintainers.siddharthist ];