2022-09-05 06:31:26 +00:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, lib
|
|
|
|
, pscale
|
|
|
|
, testers
|
|
|
|
}:
|
2021-07-03 08:32:03 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "pscale";
|
2024-01-11 01:05:43 +00:00
|
|
|
version = "0.177.0";
|
2021-07-03 08:32:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "planetscale";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2024-01-11 01:05:43 +00:00
|
|
|
sha256 = "sha256-nvtLUrJhxqMWi/NzKw1KYOEL+1DsWfJoLXoXQI7QP6M=";
|
2021-07-03 08:32:03 +00:00
|
|
|
};
|
|
|
|
|
2024-01-04 06:22:08 +00:00
|
|
|
vendorHash = "sha256-n6vPeeOmSB/qHBGCdZHZtf3JD/wgFYD0+VO3Ir8MtqE=";
|
2022-03-27 06:48:05 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X main.version=v${version}"
|
|
|
|
"-X main.commit=v${version}"
|
|
|
|
"-X main.date=unknown"
|
|
|
|
];
|
2021-07-03 08:32:03 +00:00
|
|
|
|
2022-09-05 06:31:26 +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-03 08:32:03 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "The CLI for PlanetScale Database";
|
2022-09-05 06:31:26 +00:00
|
|
|
changelog = "https://github.com/planetscale/cli/releases/tag/v${version}";
|
|
|
|
homepage = "https://www.planetscale.com/";
|
2021-07-03 08:32:03 +00:00
|
|
|
license = licenses.asl20;
|
2023-09-03 01:55:12 +00:00
|
|
|
maintainers = with maintainers; [ pimeys kashw2 ];
|
2021-07-03 08:32:03 +00:00
|
|
|
};
|
|
|
|
}
|