depot/third_party/nixpkgs/pkgs/applications/version-management/gitsign/default.nix
Default email 87f9c27ba9 Project import generated by Copybara.
GitOrigin-RevId: fe2ecaf706a5907b5e54d979fbde4924d84b65fc
2023-04-12 14:48:02 +02:00

44 lines
1.2 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, stdenv, makeWrapper, gitMinimal, testers, gitsign }:
buildGoModule rec {
pname = "gitsign";
version = "0.6.0";
src = fetchFromGitHub {
owner = "sigstore";
repo = pname;
rev = "v${version}";
hash = "sha256-VgkTFYnHKpqZOack5SabOFu2BRespVRhgrsepo0V1mI=";
};
vendorHash = "sha256-zalysp+90+QM5hX7yUudJW61h+3tQOab7ZpcF5kZSB0=";
subPackages = [
"."
"cmd/gitsign-credential-cache"
];
nativeBuildInputs = [ makeWrapper ];
ldflags = [ "-s" "-w" "-buildid=" "-X github.com/sigstore/gitsign/pkg/version.gitVersion=${version}" ];
preCheck = ''
# test all paths
unset subPackages
'';
postInstall = ''
for f in $out/bin/*; do
wrapProgram $f --prefix PATH : ${lib.makeBinPath [ gitMinimal ]}
done
'';
passthru.tests.version = testers.testVersion { package = gitsign; };
meta = {
homepage = "https://github.com/sigstore/gitsign";
changelog = "https://github.com/sigstore/gitsign/releases/tag/v${version}";
description = "Keyless Git signing using Sigstore";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ lesuisse developer-guy ];
};
}