Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
stdenv,
buildPackages,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "diffoci";
version = "0.1.7";
src = fetchFromGitHub {
owner = "reproducible-containers";
repo = "diffoci";
rev = "v${version}";
hash = "sha256-RBMgcTUdPO12rFUY82JkubXfaGjfB4oR+UqKwumFWs0=";
};
vendorHash = "sha256-NqYGehd+RcspQt5gQl9XH85Ds0dw+MU8W7xH/uzNjqU=";
ldflags = [
"-s"
"-w"
"-X=github.com/reproducible-containers/diffoci/cmd/diffoci/version.Version=v${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall =
let
diffoci =
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
placeholder "out"
else
buildPackages.diffoci;
in
''
installShellCompletion --cmd diffoci \
--bash <(${diffoci}/bin/diffoci completion bash) \
--fish <(${diffoci}/bin/diffoci completion fish) \
--zsh <(${diffoci}/bin/diffoci completion zsh)
'';
meta = with lib; {
description = "Diff for Docker and OCI container images";
homepage = "https://github.com/reproducible-containers/diffoci/";
license = licenses.asl20;
maintainers = with maintainers; [ jk ];
mainProgram = "diffoci";
};
}