# 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 ]; }; }