2023-08-10 07:59:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv,
|
|
|
|
buildGo121Module,
|
2023-08-10 07:59:29 +00:00
|
|
|
fetchFromGitHub,
|
2023-10-09 19:29:22 +00:00
|
|
|
installShellFiles,
|
2023-08-10 07:59:29 +00:00
|
|
|
}:
|
2023-10-09 19:29:22 +00:00
|
|
|
buildGo121Module rec {
|
2023-08-10 07:59:29 +00:00
|
|
|
pname = "turso-cli";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.85.3";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tursodatabase";
|
|
|
|
repo = "turso-cli";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-dJpHrqPyikkUnE4Un1fGOEJL49U5IiInYeSWmI04r18=";
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-Hv4CacBrRX2YT3AkbNzyWrA9Ex6YMDPrPvezukwMkTE=";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
# Build with production code
|
|
|
|
tags = ["prod"];
|
|
|
|
# Include version for `turso --version` reporting
|
|
|
|
preBuild = ''
|
|
|
|
echo "v${version}" > internal/cmd/version.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "This is the command line interface (CLI) to Turso.";
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|