Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 55 lines 1.3 kB view raw
1{ 2 stdenv, 3 lib, 4 buildGoModule, 5 fetchFromGitHub, 6 installShellFiles, 7 buildPackages, 8}: 9 10buildGoModule rec { 11 pname = "doctl"; 12 version = "1.135.0"; 13 14 vendorHash = null; 15 16 doCheck = false; 17 18 subPackages = [ "cmd/doctl" ]; 19 20 ldflags = 21 let 22 t = "github.com/digitalocean/doctl"; 23 in 24 [ 25 "-X ${t}.Major=${lib.versions.major version}" 26 "-X ${t}.Minor=${lib.versions.minor version}" 27 "-X ${t}.Patch=${lib.versions.patch version}" 28 "-X ${t}.Label=release" 29 ]; 30 31 nativeBuildInputs = [ installShellFiles ]; 32 33 postInstall = '' 34 export HOME=$(mktemp -d) # attempts to write to /homeless-shelter 35 for shell in bash fish zsh; do 36 ${stdenv.hostPlatform.emulator buildPackages} $out/bin/doctl completion $shell > doctl.$shell 37 installShellCompletion doctl.$shell 38 done 39 ''; 40 41 src = fetchFromGitHub { 42 owner = "digitalocean"; 43 repo = "doctl"; 44 tag = "v${version}"; 45 hash = "sha256-eLv3sgoVLY5lqOfDSl5rel+LTgxbHmbi7LeSt6RKuVw="; 46 }; 47 48 meta = { 49 description = "Command line tool for DigitalOcean services"; 50 mainProgram = "doctl"; 51 homepage = "https://github.com/digitalocean/doctl"; 52 license = lib.licenses.asl20; 53 maintainers = [ lib.maintainers.siddharthist ]; 54 }; 55}