nerdfonts: fix wrong attribute name in error message (#364463)
[NixPkgs.git] / pkgs / by-name / do / doctl / package.nix
blob2397da1f26256b30e910ce424dff7ef14cf236fb
1 { stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, buildPackages }:
3 buildGoModule rec {
4   pname = "doctl";
5   version = "1.116.0";
7   vendorHash = null;
9   doCheck = false;
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"
18   ];
20   nativeBuildInputs = [ installShellFiles ];
22   postInstall = ''
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
27     done
28   '';
30   src = fetchFromGitHub {
31     owner = "digitalocean";
32     repo = "doctl";
33     rev = "v${version}";
34     sha256 = "sha256-yUgOHkQfsl1FgkOQirbEKzyrPcjs/k2H0P3jx3LHaiU=";
35   };
37   meta = with lib; {
38     description = "Command line tool for DigitalOcean services";
39     mainProgram = "doctl";
40     homepage = "https://github.com/digitalocean/doctl";
41     license = licenses.asl20;
42     maintainers = [ maintainers.siddharthist ];
43   };