2023-08-10 07:59:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv,
|
2024-01-25 14:12:00 +00:00
|
|
|
buildGoModule,
|
2023-08-10 07:59:29 +00:00
|
|
|
fetchFromGitHub,
|
2023-10-09 19:29:22 +00:00
|
|
|
installShellFiles,
|
2023-10-19 13:55:26 +00:00
|
|
|
nix-update-script,
|
2023-08-10 07:59:29 +00:00
|
|
|
}:
|
2024-01-25 14:12:00 +00:00
|
|
|
buildGoModule rec {
|
2023-08-10 07:59:29 +00:00
|
|
|
pname = "turso-cli";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "0.97.2";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tursodatabase";
|
|
|
|
repo = "turso-cli";
|
|
|
|
rev = "v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-6Ci1QESSN6wNpUAQoWtTyHWrGaI/3xs/jGCSkJsYC8o=";
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
vendorHash = "sha256-tBO21IgUczwMgrEyV7scV3YTY898lYHASaLeXqvBopU=";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X github.com/tursodatabase/turso-cli/internal/cmd.version=v${version}"
|
|
|
|
];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
|
|
installShellCompletion --cmd turso \
|
|
|
|
--bash <($out/bin/turso completion bash) \
|
|
|
|
--fish <($out/bin/turso completion fish) \
|
|
|
|
--zsh <($out/bin/turso completion zsh)
|
|
|
|
'';
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "This is the command line interface (CLI) to Turso";
|
2023-08-10 07:59:29 +00:00
|
|
|
homepage = "https://turso.tech";
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "turso";
|
2023-08-10 07:59:29 +00:00
|
|
|
license = licenses.mit;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ zestsystem kashw2 fryuni ];
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
|
|
|
}
|