Skip to content

Commit

Permalink
Merge pull request NixOS#275225 from 06kellyjac/witness
Browse files Browse the repository at this point in the history
witness: 0.1.14 -> 0.2.0
  • Loading branch information
marsam authored Dec 23, 2023
2 parents 92847f5 + ba11179 commit 2503dd2
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions pkgs/tools/security/witness/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles

# testing
, testers
, witness
}:

buildGoModule rec {
pname = "witness";
version = "0.1.14";
version = "0.2.0";

src = fetchFromGitHub {
owner = "testifysec";
repo = pname;
owner = "in-toto";
repo = "witness";
rev = "v${version}";
sha256 = "sha256-TUEbFkrS0OztTiY0OXiZsqraq3TINtC/DQEyCGPNXpE=";
sha256 = "sha256-U+dcaPi9Drg4I2SZlZPaR3Ryb+Dz27nyPI2XJPG/LWc=";
};
proxyVendor = true;
vendorHash = "sha256-L2NaEt64mgFZVta/F8/uUQ4djlra59JPcHJLGbFCQJs=";
vendorHash = "sha256-pjcyAGdR8TsU9YBy5zd6u575vDKPwy8s85TXUsuxZiU=";

nativeBuildInputs = [ installShellFiles ];

Expand All @@ -21,7 +28,7 @@ buildGoModule rec {
ldflags = [
"-s"
"-w"
"-X github.com/testifysec/witness/cmd.Version=v${version}"
"-X github.com/in-toto/witness/cmd.Version=v${version}"
];

# Feed in all tests for testing
Expand All @@ -38,13 +45,11 @@ buildGoModule rec {
--zsh <($out/bin/witness completion zsh)
'';

doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/witness --help
$out/bin/witness version | grep "v${version}"
runHook postInstallCheck
'';
passthru.tests.version = testers.testVersion {
package = witness;
command = "witness version";
version = "v${version}";
};

meta = with lib; {
description = "A pluggable framework for software supply chain security. Witness prevents tampering of build materials and verifies the integrity of the build process from source to target";
Expand All @@ -57,6 +62,7 @@ buildGoModule rec {
PKI distribution system will mitigate against many software supply chain
attack vectors and can be used as a framework for automated governance.
'';
mainProgram = "witness";
homepage = "https://github.com/testifysec/witness";
changelog = "https://github.com/testifysec/witness/releases/tag/v${version}";
license = licenses.asl20;
Expand Down

0 comments on commit 2503dd2

Please sign in to comment.