summary refs log tree commit diff
path: root/pkgs/tools/security/fulcio/default.nix
blob: 4539f10e50d22038c6c6df57f1e8d4415300910b (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
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:

buildGoModule rec {
  pname = "fulcio";
  version = "0.1.0";

  src = fetchFromGitHub {
    owner = "sigstore";
    repo = pname;
    rev = version;
    sha256 = "sha256-+HWzhg+LTKpr9VJ9mzQghwOuGgp3EBb4/zltaqp0zHw=";
  };
  vendorSha256 = "sha256-1tR1vUm5eFBS93kELQoKWEyFlfMF28GBI8VEHxTyeM4=";

  ldflags = [ "-s" "-w" ];

  # Install completions post-install
  nativeBuildInputs = [ installShellFiles ];

  postInstall = ''
    installShellCompletion --cmd fulcio \
      --bash <($out/bin/fulcio completion bash) \
      --fish <($out/bin/fulcio completion fish) \
      --zsh <($out/bin/fulcio completion zsh)
  '';

  doInstallCheck = true;
  installCheckPhase = ''
    runHook preInstallCheck
    $out/bin/fulcio --help
    runHook postInstallCheck
  '';

  meta = with lib; {
    homepage = "https://github.com/sigstore/fulcio";
    changelog = "https://github.com/sigstore/fulcio/releases/tag/${version}";
    description = "A Root-CA for code signing certs - issuing certificates based on an OIDC email address";
    license = licenses.asl20;
    maintainers = with maintainers; [ lesuisse jk ];
  };
}