depot/third_party/nixpkgs/pkgs/development/tools/regclient/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

41 lines
980 B
Nix

{ stdenv, lib, buildGoModule, fetchFromGitHub }:
let bins = [ "regbot" "regctl" "regsync" ]; in
buildGoModule rec {
pname = "regclient";
version = "0.5.2";
tag = "v${version}";
src = fetchFromGitHub {
owner = "regclient";
repo = "regclient";
rev = tag;
sha256 = "sha256-PC3eHTmhjNjf3ENeP3ODrR2Ynlzg4FqJL6L8cKvD67A=";
};
vendorHash = "sha256-OPB/xGdaq1yv4ATrKbLcqqJj84s0cYrJdmKFHZ3EkHY=";
outputs = [ "out" ] ++ bins;
ldflags = [
"-s"
"-w"
"-X main.VCSTag=${tag}"
];
postInstall =
lib.concatStringsSep "\n" (
map (bin: ''
mkdir -p ''$${bin}/bin &&
mv $out/bin/${bin} ''$${bin}/bin/ &&
ln -s ''$${bin}/bin/${bin} $out/bin/
'') bins
);
meta = with lib; {
description = "Docker and OCI Registry Client in Go and tooling using those libraries";
homepage = "https://github.com/regclient/regclient";
license = licenses.asl20;
maintainers = with maintainers; [ ];
};
}