2022-12-28 21:21:41 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
2023-04-29 16:46:19 +00:00
|
|
|
, testers
|
|
|
|
, supabase-cli
|
2022-12-28 21:21:41 +00:00
|
|
|
, nix-update-script
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "supabase-cli";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.162.6";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "supabase";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-BCJlYutgfHlJqUR1W/yWHkc/trszUuZZmgMMGd1XdFU=";
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
vendorHash = "sha256-n69PwTcjEWqLetcRUM1YFkovYsE90Q3WaoBr4L/IwQU=";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X=github.com/supabase/cli/internal/utils.Version=${version}"
|
|
|
|
];
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
doCheck = false; # tests are trying to connect to localhost
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-04-29 16:46:19 +00:00
|
|
|
rm $out/bin/{codegen,docs,listdep}
|
2022-12-28 21:21:41 +00:00
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = supabase-cli;
|
|
|
|
};
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A CLI for interacting with supabase";
|
|
|
|
homepage = "https://github.com/supabase/cli";
|
|
|
|
license = licenses.mit;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ gerschtli kashw2 ];
|
2022-12-28 21:21:41 +00:00
|
|
|
mainProgram = "supabase";
|
|
|
|
};
|
|
|
|
}
|