2021-11-03 08:10:38 +01:00
|
|
|
{ stdenv, lib, buildGoModule, fetchFromGitHub, pcsclite, pkg-config, installShellFiles, PCSC, pivKeySupport ? true }:
|
2021-03-27 18:20:18 +01:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "cosign";
|
2021-11-03 08:10:38 +01:00
|
|
|
version = "1.3.0";
|
2021-03-27 18:20:18 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigstore";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-11-03 08:10:38 +01:00
|
|
|
sha256 = "sha256-VKlM+bsK2Oj0UB4LF10pHEIJqXv6cAO5rtxnTogpfOk=";
|
2021-03-27 18:20:18 +01:00
|
|
|
};
|
|
|
|
|
2021-11-03 08:10:38 +01:00
|
|
|
buildInputs = lib.optional (stdenv.isLinux && pivKeySupport) (lib.getDev pcsclite)
|
2021-07-14 20:08:39 +02:00
|
|
|
++ lib.optionals (stdenv.isDarwin && pivKeySupport) [ PCSC ];
|
2021-04-20 08:53:31 +02:00
|
|
|
|
2021-11-03 08:10:38 +01:00
|
|
|
nativeBuildInputs = [ pkg-config installShellFiles ];
|
2021-04-20 08:53:31 +02:00
|
|
|
|
2021-11-03 08:10:38 +01:00
|
|
|
vendorSha256 = "sha256-idMvvYeP5rAT6r9RPZ9S8K9KTpVYVq06ZKSBPxWA2ms=";
|
2021-03-27 18:20:18 +01:00
|
|
|
|
2021-11-03 08:10:38 +01:00
|
|
|
excludedPackages = "\\(sample\\|webhook\\|help\\)";
|
2021-03-27 18:20:18 +01:00
|
|
|
|
2021-08-07 04:28:41 +02:00
|
|
|
tags = lib.optionals pivKeySupport [ "pivkey" ];
|
|
|
|
|
2021-11-03 08:10:38 +01:00
|
|
|
ldflags = [ "-s" "-w" "-X github.com/sigstore/cosign/cmd/cosign/cli/options.GitVersion=v${version}" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd cosign \
|
|
|
|
--bash <($out/bin/cosign completion bash) \
|
|
|
|
--fish <($out/bin/cosign completion fish) \
|
|
|
|
--zsh <($out/bin/cosign completion zsh)
|
|
|
|
'';
|
2021-04-21 08:59:20 +02:00
|
|
|
|
2021-03-27 18:20:18 +01:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/sigstore/cosign";
|
|
|
|
changelog = "https://github.com/sigstore/cosign/releases/tag/v${version}";
|
|
|
|
description = "Container Signing CLI with support for ephemeral keys and Sigstore signing";
|
|
|
|
license = licenses.asl20;
|
2021-04-21 10:06:45 +02:00
|
|
|
maintainers = with maintainers; [ lesuisse jk ];
|
2021-03-27 18:20:18 +01:00
|
|
|
};
|
|
|
|
}
|