depot/third_party/nixpkgs/pkgs/development/tools/pscale/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

52 lines
1.2 KiB
Nix

{ buildGoModule
, fetchFromGitHub
, installShellFiles
, lib
, pscale
, testers
}:
buildGoModule rec {
pname = "pscale";
version = "0.209.0";
src = fetchFromGitHub {
owner = "planetscale";
repo = "cli";
rev = "v${version}";
sha256 = "sha256-XbGxFpkAVPhOShZWE6W/Z26NSOumB+1oh/o0zVVswL8=";
};
vendorHash = "sha256-5Uul5c8Lwu6SJ7DlLU8+k2Pxa3V/DhqdvK5xY2g6S40=";
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)
'';
__darwinAllowLocalNetworking = true;
passthru.tests.version = testers.testVersion {
package = pscale;
};
meta = with lib; {
description = "CLI for PlanetScale Database";
mainProgram = "pscale";
changelog = "https://github.com/planetscale/cli/releases/tag/v${version}";
homepage = "https://www.planetscale.com/";
license = licenses.asl20;
maintainers = with maintainers; [ pimeys kashw2 ];
};
}