2022-11-20 21:06:11 +01:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
2023-04-25 17:04:23 +02:00
|
|
|
, testers
|
|
|
|
, supabase-cli
|
2022-12-21 23:12:18 +01:00
|
|
|
, nix-update-script
|
2022-11-20 21:06:11 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "supabase-cli";
|
2023-08-06 18:19:29 +02:00
|
|
|
version = "1.83.5";
|
2022-11-20 21:06:11 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "supabase";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2023-08-06 18:19:29 +02:00
|
|
|
sha256 = "sha256-rTM8DRFMDBG+bLMlKwQimacYD2is5SxAg52ff37sz5Q=";
|
2022-11-20 21:06:11 +01:00
|
|
|
};
|
|
|
|
|
2023-07-30 08:26:23 +02:00
|
|
|
vendorSha256 = "sha256-/jYZp0bZUIHUn2Tmbgrpvz3mTQt3rF14wbcvWhEUAzw=";
|
2022-11-20 21:06:11 +01:00
|
|
|
|
2023-04-25 16:36:40 +02:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X=github.com/supabase/cli/internal/utils.Version=${version}"
|
|
|
|
];
|
2022-11-20 21:06:11 +01:00
|
|
|
|
|
|
|
doCheck = false; # tests are trying to connect to localhost
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-04-17 03:06:04 +02:00
|
|
|
rm $out/bin/{codegen,docs,listdep}
|
2022-11-20 21:06:11 +01: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-25 17:04:23 +02:00
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = supabase-cli;
|
|
|
|
};
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
2022-12-21 23:12:18 +01:00
|
|
|
|
2022-11-20 21:06:11 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A CLI for interacting with supabase";
|
|
|
|
homepage = "https://github.com/supabase/cli";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ gerschtli ];
|
|
|
|
mainProgram = "supabase";
|
|
|
|
};
|
|
|
|
}
|