Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7 nix-update-script,
8}:
9buildGoModule rec {
10 pname = "turso-cli";
11 version = "1.0.11";
12
13 src = fetchFromGitHub {
14 owner = "tursodatabase";
15 repo = "turso-cli";
16 rev = "v${version}";
17 hash = "sha256-Is1WlwMLkXaKxHUzAGSJN/xVFC7ZQ3C/TS6McAn7ACQ=";
18 };
19
20 vendorHash = "sha256-tBO21IgUczwMgrEyV7scV3YTY898lYHASaLeXqvBopU=";
21
22 nativeBuildInputs = [ installShellFiles ];
23
24 ldflags = [
25 "-X github.com/tursodatabase/turso-cli/internal/cmd.version=v${version}"
26 ];
27
28 preCheck = ''
29 export HOME=$(mktemp -d)
30 '';
31
32 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
33 installShellCompletion --cmd turso \
34 --bash <($out/bin/turso completion bash) \
35 --fish <($out/bin/turso completion fish) \
36 --zsh <($out/bin/turso completion zsh)
37 '';
38
39 passthru.updateScript = nix-update-script { };
40
41 meta = with lib; {
42 description = "This is the command line interface (CLI) to Turso";
43 homepage = "https://turso.tech";
44 mainProgram = "turso";
45 license = licenses.mit;
46 maintainers = with maintainers; [
47 zestsystem
48 kashw2
49 fryuni
50 ];
51 };
52}