2022-09-11 15:47:08 +00:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, lib
|
|
|
|
, pscale
|
|
|
|
, testers
|
|
|
|
}:
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "pscale";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.161.0";
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "planetscale";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "sha256-7PzuFhlOlU5uGsJyGOY761JfzqaPkkkftRlYrvUKEoU=";
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
vendorHash = "sha256-fhYd2C9xY0kQez6+MofimJP+brLvMDFXlW6kDSI4iqA=";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X main.version=v${version}"
|
|
|
|
"-X main.commit=v${version}"
|
|
|
|
"-X main.date=unknown"
|
|
|
|
];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2022-09-11 15:47:08 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "The CLI for PlanetScale Database";
|
2022-09-11 15:47:08 +00:00
|
|
|
changelog = "https://github.com/planetscale/cli/releases/tag/v${version}";
|
|
|
|
homepage = "https://www.planetscale.com/";
|
2021-07-14 22:03:04 +00:00
|
|
|
license = licenses.asl20;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ pimeys kashw2 ];
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
|
|
|
}
|