depot/pkgs/development/tools/pscale/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

52 lines
1.2 KiB
Nix

{ buildGoModule
, fetchFromGitHub
, installShellFiles
, lib
, pscale
, testers
}:
buildGoModule rec {
pname = "pscale";
version = "0.213.0";
src = fetchFromGitHub {
owner = "planetscale";
repo = "cli";
rev = "v${version}";
sha256 = "sha256-WgivwlsT8QytB6oaB8lQASq+YQa8lbe/6PwpJUFZifU=";
};
vendorHash = "sha256-R0ZabOquZQLONbW6p5xtYKLi8P3Q5JieM4EATT1a83U=";
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 ];
};
}