Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 installShellFiles, 6}: 7 8buildGoModule rec { 9 pname = "exoscale-cli"; 10 version = "1.85.3"; 11 12 src = fetchFromGitHub { 13 owner = "exoscale"; 14 repo = "cli"; 15 rev = "v${version}"; 16 sha256 = "sha256-NAAKm6uaeg3GwbjXn82rENO8Rh6HR7Vu8cm3Yf1X8X4="; 17 }; 18 19 vendorHash = null; 20 21 nativeBuildInputs = [ installShellFiles ]; 22 23 excludedPackages = [ "internal/integ" ]; 24 25 ldflags = [ 26 "-s" 27 "-w" 28 "-X main.version=${version}" 29 "-X main.commit=${src.rev}" 30 ]; 31 32 # we need to rename the resulting binary but can't use buildFlags with -o here 33 # because these are passed to "go install" which does not recognize -o 34 postBuild = '' 35 mv $GOPATH/bin/cli $GOPATH/bin/exo 36 37 mkdir -p manpage 38 $GOPATH/bin/docs --man-page 39 rm $GOPATH/bin/docs 40 41 $GOPATH/bin/completion bash 42 $GOPATH/bin/completion zsh 43 rm $GOPATH/bin/completion 44 ''; 45 46 postInstall = '' 47 installManPage manpage/* 48 installShellCompletion --cmd exo --bash bash_completion --zsh zsh_completion 49 ''; 50 51 meta = { 52 description = "Command-line tool for everything at Exoscale: compute, storage, dns"; 53 homepage = "https://github.com/exoscale/cli"; 54 license = lib.licenses.asl20; 55 maintainers = with lib.maintainers; [ viraptor ]; 56 mainProgram = "exo"; 57 }; 58}