2022-09-05 08:31:26 +02:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, lib
|
|
|
|
, pscale
|
|
|
|
, testers
|
|
|
|
}:
|
2021-07-03 10:32:03 +02:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "pscale";
|
2024-04-26 01:38:37 +02:00
|
|
|
version = "0.197.0";
|
2021-07-03 10:32:03 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "planetscale";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2024-04-26 01:38:37 +02:00
|
|
|
sha256 = "sha256-Yjnq6ALbuvkYIOZ4CdBq1naTPGgT3aX0wRmREZpHo7I=";
|
2021-07-03 10:32:03 +02:00
|
|
|
};
|
|
|
|
|
2024-04-26 01:38:37 +02:00
|
|
|
vendorHash = "sha256-TdRfff342QvwjBC6B6/npbkvaH3o9CBKe2exu6TnT2o=";
|
2022-03-27 08:48:05 +02:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X main.version=v${version}"
|
|
|
|
"-X main.commit=v${version}"
|
|
|
|
"-X main.date=unknown"
|
|
|
|
];
|
2021-07-03 10:32:03 +02:00
|
|
|
|
2022-09-05 08:31:26 +02: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-03 10:32:03 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "The CLI for PlanetScale Database";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "pscale";
|
2022-09-05 08:31:26 +02:00
|
|
|
changelog = "https://github.com/planetscale/cli/releases/tag/v${version}";
|
|
|
|
homepage = "https://www.planetscale.com/";
|
2021-07-03 10:32:03 +02:00
|
|
|
license = licenses.asl20;
|
2023-09-03 03:55:12 +02:00
|
|
|
maintainers = with maintainers; [ pimeys kashw2 ];
|
2021-07-03 10:32:03 +02:00
|
|
|
};
|
|
|
|
}
|