mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 10:43:27 +00:00
50 lines
1.1 KiB
Nix
50 lines
1.1 KiB
Nix
{ buildGoModule
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, lib
|
|
, pscale
|
|
, testers
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "pscale";
|
|
version = "0.115.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "planetscale";
|
|
repo = "cli";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-XiTH3Ep7dTvAdE3AAjPJztEcnvWqX+qf/zED8xpC9N0=";
|
|
};
|
|
|
|
vendorSha256 = "sha256-arTp77VocH5isIoq3B55G/6sQjVbmoduCywiJYJaAws=";
|
|
|
|
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 ];
|
|
};
|
|
}
|