depot/third_party/nixpkgs/pkgs/by-name/at/atlas/package.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

46 lines
1.2 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, atlas }:
buildGoModule rec {
pname = "atlas";
version = "0.28.0";
src = fetchFromGitHub {
owner = "ariga";
repo = "atlas";
rev = "v${version}";
hash = "sha256-D6dHHTxD2eObmXwYntIOtcPsU1vP+K289n+XVoaGUVc=";
};
modRoot = "cmd/atlas";
proxyVendor = true;
vendorHash = "sha256-SFG//hc5vLQXC3SeEn4YRcc82PItYZy+TNqzq19sRnI=";
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";
};
}