2021-04-06 10:00:40 +02:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
|
|
|
|
2021-09-29 19:51:13 +02:00
|
|
|
let bins = [ "crane" "gcrane" ]; in
|
|
|
|
|
2021-04-06 10:00:40 +02:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "go-containerregistry";
|
2021-09-29 19:51:13 +02:00
|
|
|
version = "0.6.0";
|
2021-04-06 10:00:40 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-09-29 19:51:13 +02:00
|
|
|
sha256 = "0sk3g1i4w8sh40y1ffa61ap7jsscdvnhvh09k8nznydi465csbmq";
|
2021-04-06 10:00:40 +02:00
|
|
|
};
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
subPackages = [ "cmd/crane" "cmd/gcrane" ];
|
|
|
|
|
2021-09-29 19:51:13 +02:00
|
|
|
outputs = [ "out" ] ++ bins;
|
|
|
|
|
2021-08-08 14:08:13 +02:00
|
|
|
ldflags =
|
|
|
|
let t = "github.com/google/go-containerregistry"; in
|
|
|
|
[ "-s" "-w" "-X ${t}/cmd/crane/cmd.Version=v${version}" "-X ${t}/pkg/v1/remote/transport.Version=${version}" ];
|
2021-04-06 10:00:40 +02:00
|
|
|
|
2021-09-29 19:51:13 +02:00
|
|
|
postInstall =
|
|
|
|
lib.concatStringsSep "\n" (
|
|
|
|
map (bin: ''
|
|
|
|
mkdir -p ''$${bin}/bin &&
|
|
|
|
mv $out/bin/${bin} ''$${bin}/bin/ &&
|
|
|
|
ln -s ''$${bin}/bin/${bin} $out/bin/
|
|
|
|
'') bins
|
|
|
|
);
|
|
|
|
|
2021-04-06 10:00:40 +02:00
|
|
|
# NOTE: no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-08-08 14:08:13 +02:00
|
|
|
description = "Tools for interacting with remote images and registries including crane and gcrane";
|
2021-04-06 10:00:40 +02:00
|
|
|
homepage = "https://github.com/google/go-containerregistry";
|
|
|
|
license = licenses.apsl20;
|
2021-11-03 01:38:27 +01:00
|
|
|
maintainers = with maintainers; [ yurrriq ];
|
2021-04-06 10:00:40 +02:00
|
|
|
};
|
|
|
|
}
|