Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ buildGoModule 2, fetchFromGitHub 3, installShellFiles 4, lib 5, pscale 6, testers 7}: 8 9buildGoModule rec { 10 pname = "pscale"; 11 version = "0.145.0"; 12 13 src = fetchFromGitHub { 14 owner = "planetscale"; 15 repo = "cli"; 16 rev = "v${version}"; 17 sha256 = "sha256-0X+cYDlc7yIJTA4O06Y5roj6bL7mQlZK7jIAs0RbM7U="; 18 }; 19 20 vendorHash = "sha256-brfrAD4cJ/MwT9ZiwN6a25vCWTcRMiszbuLWj3Lk2Kc="; 21 22 ldflags = [ 23 "-s" "-w" 24 "-X main.version=v${version}" 25 "-X main.commit=v${version}" 26 "-X main.date=unknown" 27 ]; 28 29 nativeBuildInputs = [ installShellFiles ]; 30 31 postInstall = '' 32 installShellCompletion --cmd pscale \ 33 --bash <($out/bin/pscale completion bash) \ 34 --fish <($out/bin/pscale completion fish) \ 35 --zsh <($out/bin/pscale completion zsh) 36 ''; 37 38 passthru.tests.version = testers.testVersion { 39 package = pscale; 40 }; 41 42 meta = with lib; { 43 description = "The CLI for PlanetScale Database"; 44 changelog = "https://github.com/planetscale/cli/releases/tag/v${version}"; 45 homepage = "https://www.planetscale.com/"; 46 license = licenses.asl20; 47 maintainers = with maintainers; [ pimeys ]; 48 }; 49}