571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, gitMinimal, testers, gitsign }:
|
|
|
|
buildGoModule rec {
|
|
pname = "gitsign";
|
|
version = "0.10.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "sigstore";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-JNCz5MVqn8PeTfYUVowIVZwtpfD+Gx9yBckter6PfXA=";
|
|
};
|
|
vendorHash = "sha256-QW+ZWYEXkhSQR4HvmPLENzY/VEfjEX43mBPhmhsEBMI=";
|
|
|
|
subPackages = [
|
|
"."
|
|
"cmd/gitsign-credential-cache"
|
|
];
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
ldflags = [ "-s" "-w" "-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 ];
|
|
};
|
|
}
|