depot/third_party/nixpkgs/pkgs/development/tools/regclient/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

41 lines
980 B
Nix

{ stdenv, lib, buildGoModule, fetchFromGitHub }:
let bins = [ "regbot" "regctl" "regsync" ]; in
buildGoModule rec {
pname = "regclient";
version = "0.5.5";
tag = "v${version}";
src = fetchFromGitHub {
owner = "regclient";
repo = "regclient";
rev = tag;
sha256 = "sha256-s1eP1uj5WbHd59AYsm2t3+iOJKMMHZQ7xwjvy/yrICk=";
};
vendorHash = "sha256-JIvFHaq9RCqDurKTnoT9/yJevHotuG22AyizTMLtHPc=";
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; [ ];
};
}