Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, copilot-cli }: 2 3buildGoModule rec { 4 pname = "copilot-cli"; 5 version = "1.28.0"; 6 7 src = fetchFromGitHub { 8 owner = "aws"; 9 repo = pname; 10 rev = "v${version}"; 11 sha256 = "sha256-KrgPHdYR0kYwyNhO2EwIO00Xnjy0MmrzHb5LDmbrgB0="; 12 }; 13 14 vendorHash = "sha256-1YOx7tqPJwCZlJSAG9o+STKRAIR72dptvTOpa9rRt3A="; 15 16 nativeBuildInputs = [ installShellFiles ]; 17 18 # follow LINKER_FLAGS in Makefile 19 ldflags = [ 20 "-s" 21 "-w" 22 "-X github.com/aws/copilot-cli/internal/pkg/version.Version=${version}" 23 "-X github.com/aws/copilot-cli/internal/pkg/cli.binaryS3BucketPath=https://ecs-cli-v2-release.s3.amazonaws.com" 24 ]; 25 26 subPackages = [ "./cmd/copilot" ]; 27 28 postInstall = '' 29 installShellCompletion --cmd copilot \ 30 --bash <($out/bin/copilot completion bash) \ 31 --fish <($out/bin/copilot completion fish) \ 32 --zsh <($out/bin/copilot completion zsh) 33 ''; 34 35 passthru.tests.version = testers.testVersion { 36 package = copilot-cli; 37 command = "copilot version"; 38 }; 39 40 meta = with lib; { 41 description = "Build, Release and Operate Containerized Applications on AWS."; 42 homepage = "https://github.com/aws/copilot-cli"; 43 changelog = "https://github.com/aws/copilot-cli/releases/tag/v${version}"; 44 license = licenses.asl20; 45 maintainers = with maintainers; [ jiegec ]; 46 }; 47}