nixpkgs/pkgs/development/tools/turso-cli/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.2 KiB
Nix
Raw Normal View History

{
lib,
2023-10-04 23:53:31 +00:00
stdenv,
2024-01-14 00:25:47 +00:00
buildGoModule,
fetchFromGitHub,
2023-10-04 23:53:31 +00:00
installShellFiles,
2023-10-17 21:46:42 +00:00
nix-update-script,
}:
2024-01-14 00:25:47 +00:00
buildGoModule rec {
pname = "turso-cli";
2024-06-29 10:21:33 +00:00
version = "0.96.0";
src = fetchFromGitHub {
owner = "tursodatabase";
repo = "turso-cli";
rev = "v${version}";
2024-06-29 10:21:33 +00:00
hash = "sha256-SgUlGzQy+K+GhrbZR/lnKyLsI5cjXxBu/SpNqlfe5IA=";
};
2024-06-29 10:21:33 +00:00
vendorHash = "sha256-Za8njJ0aExZe2LmQe6q9Q0Phjo1ot3bYK/zGNzyi7fo=";
2023-10-05 10:43:14 +00:00
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-X github.com/tursodatabase/turso-cli/internal/cmd.version=v${version}"
];
2023-10-05 10:43:14 +00:00
preCheck = ''
export HOME=$(mktemp -d)
'';
2023-10-04 23:53:31 +00:00
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-10-17 21:46:42 +00:00
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "This is the command line interface (CLI) to Turso";
homepage = "https://turso.tech";
mainProgram = "turso";
license = licenses.mit;
2023-10-04 23:53:43 +00:00
maintainers = with maintainers; [ zestsystem kashw2 fryuni ];
};
}