mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 00:24:18 +00:00
58 lines
1.2 KiB
Nix
58 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
testers,
|
|
atlas,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "atlas";
|
|
version = "0.29.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ariga";
|
|
repo = "atlas";
|
|
rev = "v${version}";
|
|
hash = "sha256-synQZAOnX5Xw5d7pHPr7eaycf/YErktCjlsPVwbyLks=";
|
|
};
|
|
|
|
modRoot = "cmd/atlas";
|
|
|
|
proxyVendor = true;
|
|
vendorHash = "sha256-bQNcLFSMED5zFxf319fAeLLrVeZMCV/33s9hCm1elFs=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X ariga.io/atlas/cmd/atlas/internal/cmdapi.version=v${version}"
|
|
];
|
|
|
|
subPackages = [ "." ];
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd atlas \
|
|
--bash <($out/bin/atlas completion bash) \
|
|
--fish <($out/bin/atlas completion fish) \
|
|
--zsh <($out/bin/atlas completion zsh)
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = atlas;
|
|
command = "atlas version";
|
|
version = "v${version}";
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Modern tool for managing database schemas";
|
|
homepage = "https://atlasgo.io/";
|
|
changelog = "https://github.com/ariga/atlas/releases/tag/v${version}";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ aaronjheng ];
|
|
mainProgram = "atlas";
|
|
};
|
|
}
|