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";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.25.0";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ariga";
|
|
|
|
repo = "atlas";
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-X8r1DCuKswM9C7HaSkPbyOs9uRG+KGTzWCxGgvajr6k=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
modRoot = "cmd/atlas";
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
proxyVendor = true;
|
2024-07-27 06:49:29 +00:00
|
|
|
vendorHash = "sha256-wmvWdUqSPmTaGNDuTJPNEqlJcxy+ckAjHvHH9L7aAGg=";
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Modern tool for managing database schemas";
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://atlasgo.io/";
|
|
|
|
changelog = "https://github.com/ariga/atlas/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [ aaronjheng ];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "atlas";
|
|
|
|
};
|
|
|
|
}
|