1{ stdenv, lib, buildGoModule, fetchFromGitHub }:
2
3let bins = [ "regbot" "regctl" "regsync" ]; in
4
5buildGoModule rec {
6 pname = "regclient";
7 version = "0.5.3";
8 tag = "v${version}";
9
10 src = fetchFromGitHub {
11 owner = "regclient";
12 repo = "regclient";
13 rev = tag;
14 sha256 = "sha256-cYfQ27QPdx3TA7zUZ7x0+kIr//EXL+a2APK5pnlupJM=";
15 };
16 vendorHash = "sha256-UbzMkHpmIfJoCToAT1vOYJvqkhxSGogohT2aemegZ94=";
17
18 outputs = [ "out" ] ++ bins;
19
20 ldflags = [
21 "-s"
22 "-w"
23 "-X main.VCSTag=${tag}"
24 ];
25
26 postInstall =
27 lib.concatStringsSep "\n" (
28 map (bin: ''
29 mkdir -p ''$${bin}/bin &&
30 mv $out/bin/${bin} ''$${bin}/bin/ &&
31 ln -s ''$${bin}/bin/${bin} $out/bin/
32 '') bins
33 );
34
35 meta = with lib; {
36 description = "Docker and OCI Registry Client in Go and tooling using those libraries";
37 homepage = "https://github.com/regclient/regclient";
38 license = licenses.asl20;
39 maintainers = with maintainers; [ ];
40 };
41}