Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
lib,
pscale,
testers,
}:
buildGoModule rec {
pname = "pscale";
version = "0.258.0";
src = fetchFromGitHub {
owner = "planetscale";
repo = "cli";
rev = "v${version}";
sha256 = "sha256-FsDcZcha8jR+jTbZbL/34SDUS/GvyAtuWL2NK0Okofc=";
};
vendorHash = "sha256-bzJydUOC08NLVVwEzJ+ZSC65lI4EKS1gzjTMIN3rukM=";
ldflags = [
"-s"
"-w"
"-X main.version=v${version}"
"-X main.commit=v${version}"
"-X main.date=unknown"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd pscale \
--bash <($out/bin/pscale completion bash) \
--fish <($out/bin/pscale completion fish) \
--zsh <($out/bin/pscale completion zsh)
'';
__darwinAllowLocalNetworking = true;
passthru.tests.version = testers.testVersion {
package = pscale;
};
meta = {
description = "CLI for PlanetScale Database";
mainProgram = "pscale";
changelog = "https://github.com/planetscale/cli/releases/tag/v${version}";
homepage = "https://www.planetscale.com/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
kashw2
];
};
}