nixpkgs/pkgs/by-name/su/supabase-cli/package.nix
2024-12-04 09:50:51 -08:00

58 lines
1.3 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, testers
, supabase-cli
, nix-update-script
}:
buildGoModule rec {
pname = "supabase-cli";
version = "2.0.0";
src = fetchFromGitHub {
owner = "supabase";
repo = "cli";
rev = "v${version}";
hash = "sha256-+5mcbI3pu9pahmUQnx8i2wctX/jF/CPTVaHJoH+Go4M=";
};
vendorHash = "sha256-nBUV8oeoZc7N8FqEbx2Cjw4XsZW3JShv3/H58qk8JEo=";
ldflags = [
"-s"
"-w"
"-X=github.com/supabase/cli/internal/utils.Version=${version}"
];
doCheck = false; # tests are trying to connect to localhost
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
rm $out/bin/{docs,listdep}
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 = {
tests.version = testers.testVersion {
package = supabase-cli;
};
updateScript = nix-update-script { };
};
meta = with lib; {
description = "CLI for interacting with supabase";
homepage = "https://github.com/supabase/cli";
license = licenses.mit;
maintainers = with maintainers; [ gerschtli kashw2 ];
mainProgram = "supabase";
};
}