nixpkgs/pkgs/by-name/re/regclient/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01: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.7.2";
tag = "v${version}";
src = fetchFromGitHub {
owner = "regclient";
repo = "regclient";
rev = tag;
sha256 = "sha256-Py/SmCptVfSJ8JA4mOxLcrkHcoiGgHHcDCdgophEOkw=";
};
vendorHash = "sha256-9nPavlBdrQqvXp6yl8wgZtt8Qo7BfqwISBrb8AeH150=";
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 ];
};
}