blob: 207060f1ffa8a5b940997c0b67c644b9f361e518 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
{ stdenv
, lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, lndir
, testers
, regclient
}:
let bins = [ "regbot" "regctl" "regsync" ]; in
buildGoModule rec {
pname = "regclient";
version = "0.6.1";
tag = "v${version}";
src = fetchFromGitHub {
owner = "regclient";
repo = "regclient";
rev = tag;
sha256 = "sha256-0TeqZeW2HTjHyHyO8EhmOUCaLTq/XpWTPQMKh58VH8M=";
};
vendorHash = "sha256-cKpsgT/YOyNEV8OQdclZnDmGKCrUjNeZCOd0zQ/bvL8=";
outputs = [ "out" ] ++ bins;
ldflags = [
"-s"
"-w"
"-X github.com/regclient/regclient/internal/version.vcsTag=${tag}"
];
nativeBuildInputs = [ installShellFiles lndir ];
postInstall = lib.concatMapStringsSep "\n"
(bin: ''
export bin=''$${bin}
export outputBin=bin
mkdir -p $bin/bin
mv $out/bin/${bin} $bin/bin
installShellCompletion --cmd ${bin} \
--bash <($bin/bin/${bin} completion bash) \
--fish <($bin/bin/${bin} completion fish) \
--zsh <($bin/bin/${bin} completion zsh)
lndir -silent $bin $out
unset bin outputBin
'')
bins;
checkFlags = [
# touches network
"-skip=^ExampleNew$"
];
passthru.tests = lib.mergeAttrsList (
map
(bin: {
"${bin}Version" = testers.testVersion {
package = regclient;
command = "${bin} version";
version = tag;
};
})
bins
);
__darwinAllowLocalNetworking = true;
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; [ maxbrunet ];
};
}
|