Files
2026-07-15 11:23:26 +00:00

69 lines
1.6 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
versionCheckHook,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "supabase-cli";
version = "2.109.1";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "supabase";
repo = "cli";
tag = "v${finalAttrs.version}";
hash = "sha256-wTqvbcYC2QeeUXUzkmvUin0oXulmhMXIiyNCXaWqPSQ=";
};
# Supabase is in the process of porting the CLI to TS, for now we continue with the Go cli.
sourceRoot = "${finalAttrs.src.name}/apps/cli-go";
vendorHash = "sha256-qfQgcdRv4GHmZWQWth3Hqknlr9yCjRkZFO0p2jeZG0A=";
ldflags = [
"-s"
"-X=github.com/supabase/cli/internal/utils.Version=${finalAttrs.version}"
];
subPackages = [ "." ];
nativeBuildInputs = [ installShellFiles ];
doCheck = false; # Root Go package does not have any tests.
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
postInstall = ''
mv $out/bin/{cli,supabase}
installShellCompletion --cmd supabase \
--bash <($out/bin/supabase completion bash) \
--fish <($out/bin/supabase completion fish) \
--zsh <($out/bin/supabase completion zsh)
'';
passthru.updateScript = nix-update-script {
# Fetch versions from GitHub releases to detect pre-releases and
# avoid updating to them.
extraArgs = [ "--use-github-releases" ];
};
meta = {
description = "CLI for interacting with supabase";
homepage = "https://github.com/supabase/cli";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
gerschtli
kashw2
yuannan
];
mainProgram = "supabase";
};
})