nixpkgs/pkgs/development/tools/pscale/default.nix

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

50 lines
1.1 KiB
Nix
Raw Normal View History

{ buildGoModule
, fetchFromGitHub
, installShellFiles
, lib
, pscale
, testers
}:
2021-07-03 09:32:03 +01:00
buildGoModule rec {
pname = "pscale";
2023-04-04 02:36:50 +01:00
version = "0.134.0";
2021-07-03 09:32:03 +01:00
src = fetchFromGitHub {
owner = "planetscale";
repo = "cli";
rev = "v${version}";
2023-04-04 02:36:50 +01:00
sha256 = "sha256-t9gTAtmBCoESotNO6vcaDcYEVIwHoZfN55MrWNaN3R8=";
2021-07-03 09:32:03 +01:00
};
2023-04-04 02:36:50 +01:00
vendorHash = "sha256-z/YjBpLw1tW0NJvIeQImYPxz4uDT59fxQW3+AYMBsVk=";
2022-03-27 07:48:05 +01:00
ldflags = [
"-s" "-w"
"-X main.version=v${version}"
"-X main.commit=v${version}"
"-X main.date=unknown"
];
2021-07-03 09:32:03 +01: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 09:32:03 +01:00
meta = with lib; {
description = "The CLI for PlanetScale Database";
changelog = "https://github.com/planetscale/cli/releases/tag/v${version}";
homepage = "https://www.planetscale.com/";
2021-07-03 09:32:03 +01:00
license = licenses.asl20;
maintainers = with maintainers; [ pimeys ];
};
}