aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/turso-cli.nix
diff options
context:
space:
mode:
authorSimen A. W. Olsen <hello@simenandre.no>2026-09-14 21:26:34 +0200
committerSimen A. W. Olsen <hello@simenandre.no>2026-09-14 21:26:34 +0200
commit6b199865d3b7ff72fa5ab8701679b005df6e84a5 (patch)
tree308330f4805dc4037b08fc4aba7275af03747bd3 /pkgs/turso-cli.nix
parente74e1c695c13b810732c31f95b7e662c00236d12 (diff)
downloaddotfiles-6b199865d3b7ff72fa5ab8701679b005df6e84a5.tar.gz
dotfiles-6b199865d3b7ff72fa5ab8701679b005df6e84a5.zip
feat(darwin): package the turso.tech cloud CLI
nixpkgs' `turso` is the database engine (tursodb), not the cloud CLI, and upstream only ships the CLI via a Homebrew tap whose sqld dependency tap is broken. Unpack the same GoReleaser tarball instead.
Diffstat (limited to 'pkgs/turso-cli.nix')
-rw-r--r--pkgs/turso-cli.nix68
1 files changed, 68 insertions, 0 deletions
diff --git a/pkgs/turso-cli.nix b/pkgs/turso-cli.nix
new file mode 100644
index 0000000..2eef835
--- /dev/null
+++ b/pkgs/turso-cli.nix
@@ -0,0 +1,68 @@
+# The turso.tech cloud CLI. Not in nixpkgs — nixpkgs' `turso` is the database
+# engine (the `tursodb` shell). Upstream ships it via a Homebrew tap whose
+# `sqld` dependency tap is broken, so this unpacks the same GoReleaser tarball.
+{
+ lib,
+ stdenvNoCC,
+ fetchurl,
+ installShellFiles,
+}:
+
+let
+ version = "1.0.32";
+
+ sources = {
+ aarch64-darwin = {
+ suffix = "Darwin_arm64";
+ hash = "sha256-nwIrfTOYZJZfPCDQk8cZEKTk7tidvEr/paSSLizSRUQ=";
+ };
+ x86_64-darwin = {
+ suffix = "Darwin_x86_64";
+ hash = "sha256-9Mk0ZKFR9QQ/gE5SDoD4PDF/t7kQZWnLk39eaKpMiHw=";
+ };
+ aarch64-linux = {
+ suffix = "Linux_arm64";
+ hash = "sha256-kmipCZ4lTlyHMIKL8FDVf9/2Zhg8i/SeJuhuy5CrMXI=";
+ };
+ x86_64-linux = {
+ suffix = "Linux_x86_64";
+ hash = "sha256-MU1Ocqez2Ltv2yEiyfz0I6AKVsVm4UDeAognbG7UNbI=";
+ };
+ };
+
+ source =
+ sources.${stdenvNoCC.hostPlatform.system}
+ or (throw "turso-cli: unsupported platform ${stdenvNoCC.hostPlatform.system}");
+in
+stdenvNoCC.mkDerivation {
+ pname = "turso-cli";
+ inherit version;
+
+ src = fetchurl {
+ url = "https://github.com/tursodatabase/homebrew-tap/releases/download/v${version}/homebrew-tap_${source.suffix}.tar.gz";
+ inherit (source) hash;
+ };
+
+ sourceRoot = ".";
+
+ nativeBuildInputs = [ installShellFiles ];
+
+ installPhase = ''
+ runHook preInstall
+ install -Dm755 turso $out/bin/turso
+ installShellCompletion \
+ --bash completions/turso.bash \
+ --zsh completions/turso.zsh \
+ --fish completions/turso.fish
+ runHook postInstall
+ '';
+
+ meta = {
+ description = "CLI for managing Turso databases in the cloud";
+ homepage = "https://github.com/tursodatabase/turso-cli";
+ license = lib.licenses.mit;
+ mainProgram = "turso";
+ platforms = lib.attrNames sources;
+ sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
+ };
+}