depot/third_party/nixpkgs/pkgs/development/tools/database/atlas/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

46 lines
1.2 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, atlas }:
buildGoModule rec {
pname = "atlas";
version = "0.24.0";
src = fetchFromGitHub {
owner = "ariga";
repo = "atlas";
rev = "v${version}";
hash = "sha256-kmsDTHnYSkCRdLXPzE5g2qzzb8EuGunrM9SDfaul8Xo=";
};
modRoot = "cmd/atlas";
proxyVendor = true;
vendorHash = "sha256-z2+u6jPTP6MOs7PTF6UzPwhnofQOhRll0zrmsLrN+PQ=";
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";
};
}