Files
nixpkgs/pkgs/by-name/re/regclient/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

86 lines
1.7 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
lndir,
testers,
regclient,
}:
let
bins = [
"regbot"
"regctl"
"regsync"
];
in
buildGoModule rec {
pname = "regclient";
version = "0.9.2";
tag = "v${version}";
src = fetchFromGitHub {
owner = "regclient";
repo = "regclient";
rev = tag;
sha256 = "sha256-m7gN6Rpj/p726a3yG0dMSOL536N7KTKwiXbckcS67GM=";
};
vendorHash = "sha256-uWlZHQ2LKPdKBsct6t8ZPNk3MzrVzpm9+Ny51wYDZZA=";
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 ];
};
}