4bac34ead1
GitOrigin-RevId: 724bfc0892363087709bd3a5a1666296759154b1
49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
{ buildGoModule
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, lib
|
|
, pscale
|
|
, testers
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "pscale";
|
|
version = "0.129.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "planetscale";
|
|
repo = "cli";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-GdJyOZ0FqLBRGeQZ5+qLYXLL8JxqigYCVuDUUs1KbN4=";
|
|
};
|
|
|
|
vendorHash = "sha256-iXT+xvmVDfFVV/bYq+hnmkz2ODUQ4fHR8z2lcaK93TE=";
|
|
|
|
ldflags = [
|
|
"-s" "-w"
|
|
"-X main.version=v${version}"
|
|
"-X main.commit=v${version}"
|
|
"-X main.date=unknown"
|
|
];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd pscale \
|
|
--bash <($out/bin/pscale completion bash) \
|
|
--fish <($out/bin/pscale completion fish) \
|
|
--zsh <($out/bin/pscale completion zsh)
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = pscale;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "The CLI for PlanetScale Database";
|
|
changelog = "https://github.com/planetscale/cli/releases/tag/v${version}";
|
|
homepage = "https://www.planetscale.com/";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ pimeys ];
|
|
};
|
|
}
|