2023-11-16 04:20:00 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, atlas }:
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "atlas";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.15.0";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ariga";
|
|
|
|
repo = "atlas";
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-qEui+Y7auNFJwLSUT90jJH7IPgNW06phbJel9y3C1bk=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
modRoot = "cmd/atlas";
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
proxyVendor = true;
|
|
|
|
vendorHash = "sha256-BJB+ZwrfZsYlyVX0G3qNQW8KexxMmc1Y9m2TRbOX6Tc=";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = atlas;
|
|
|
|
command = "atlas version";
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A modern tool for managing database schemas";
|
|
|
|
homepage = "https://atlasgo.io/";
|
|
|
|
changelog = "https://github.com/ariga/atlas/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
mainProgram = "atlas";
|
|
|
|
};
|
|
|
|
}
|