From d8abaa6147ca60a5cb459df11f3126276009f874 Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Wed, 4 Oct 2023 20:53:31 -0300 Subject: [PATCH 1/3] turso-cli: Install shell completions --- pkgs/development/tools/turso-cli/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/tools/turso-cli/default.nix b/pkgs/development/tools/turso-cli/default.nix index 36376e7c8579..f3b571a1281f 100644 --- a/pkgs/development/tools/turso-cli/default.nix +++ b/pkgs/development/tools/turso-cli/default.nix @@ -1,12 +1,16 @@ { lib, + stdenv, buildGo121Module, fetchFromGitHub, + installShellFiles, }: buildGo121Module rec { pname = "turso-cli"; version = "0.85.3"; + nativeBuildInputs = [ installShellFiles ]; + src = fetchFromGitHub { owner = "tursodatabase"; repo = "turso-cli"; @@ -23,6 +27,13 @@ buildGo121Module rec { echo "v${version}" > internal/cmd/version.txt ''; + 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) + ''; + # Test_setDatabasesCache fails due to /homeless-shelter: read-only file system error. doCheck = false; From 77544893d1171dc76c3dd625d4c817dd5be85ce5 Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Wed, 4 Oct 2023 20:53:43 -0300 Subject: [PATCH 2/3] turso-cli: Add Fryuni as maintainer --- maintainers/maintainer-list.nix | 9 +++++++++ pkgs/development/tools/turso-cli/default.nix | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 0cddee228346..8565ebeb95d4 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6003,6 +6003,15 @@ githubId = 134872; name = "Sergei Lukianov"; }; + fryuni = { + name = "Luiz Ferraz"; + email = "luiz@lferraz.com"; + github = "Fryuni"; + githubId = 11063910; + keys = [{ + fingerprint = "2109 4B0E 560B 031E F539 62C8 2B56 8731 DB24 47EC"; + }]; + }; fsagbuya = { email = "fa@m-labs.ph"; github = "fsagbuya"; diff --git a/pkgs/development/tools/turso-cli/default.nix b/pkgs/development/tools/turso-cli/default.nix index f3b571a1281f..ef5ebe3dd184 100644 --- a/pkgs/development/tools/turso-cli/default.nix +++ b/pkgs/development/tools/turso-cli/default.nix @@ -42,6 +42,6 @@ buildGo121Module rec { homepage = "https://turso.tech"; mainProgram = "turso"; license = licenses.mit; - maintainers = with maintainers; [ zestsystem kashw2 ]; + maintainers = with maintainers; [ zestsystem kashw2 fryuni ]; }; } From 37250559790d104450693425a49e5833834e9663 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:43:14 +0200 Subject: [PATCH 3/3] turso-cli: enable tests, reordering --- pkgs/development/tools/turso-cli/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/turso-cli/default.nix b/pkgs/development/tools/turso-cli/default.nix index ef5ebe3dd184..0859e1a362c2 100644 --- a/pkgs/development/tools/turso-cli/default.nix +++ b/pkgs/development/tools/turso-cli/default.nix @@ -9,8 +9,6 @@ buildGo121Module rec { pname = "turso-cli"; version = "0.85.3"; - nativeBuildInputs = [ installShellFiles ]; - src = fetchFromGitHub { owner = "tursodatabase"; repo = "turso-cli"; @@ -20,6 +18,8 @@ buildGo121Module rec { vendorHash = "sha256-Hv4CacBrRX2YT3AkbNzyWrA9Ex6YMDPrPvezukwMkTE="; + nativeBuildInputs = [ installShellFiles ]; + # Build with production code tags = ["prod"]; # Include version for `turso --version` reporting @@ -27,6 +27,10 @@ buildGo121Module rec { 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) \ @@ -34,9 +38,6 @@ buildGo121Module rec { --zsh <($out/bin/turso completion zsh) ''; - # Test_setDatabasesCache fails due to /homeless-shelter: read-only file system error. - doCheck = false; - meta = with lib; { description = "This is the command line interface (CLI) to Turso."; homepage = "https://turso.tech";