11 # ratchet uses the git sha-1 in the version string, e.g.
13 # $ ./ratchet --version
14 # ratchet 0.9.2 (d57cc1a53c022d3f87c4820bc6b64384a06c8a07, darwin/arm64)
16 # so we need to either hard-code the sha-1 corresponding to the version tag
17 # head or retain the git metadata folder and extract it using the git cli.
18 # We currently hard-code it.
19 src = fetchFromGitHub {
22 rev = "ebb7f24e0cbc288ab913b635480412934a2a5371";
23 hash = "sha256-Wt1/ahKQ8DOquXU5u6p+an9FJ5kYRl7F2EXOv/2rHlA=";
27 vendorHash = "sha256-J7LijbhpKDIfTcQMgk2x5FVaYG7Kgkba/1aSTmgs5yw=";
29 subPackages = [ "." ];
33 package_url = "github.com/sethvargo/ratchet";
38 "-X ${package_url}/internal/version.name=ratchet"
39 "-X ${package_url}/internal/version.version=${version}"
40 "-X ${package_url}/internal/version.commit=${src.rev}"
43 doInstallCheck = true;
44 installCheckPhase = ''
45 $out/bin/ratchet --version 2>&1 | grep ${version};
51 install -Dm755 "$GOPATH/bin/ratchet" -T $out/bin/ratchet
56 execution = callPackage ./tests.nix { };
60 description = "Tool for securing CI/CD workflows with version pinning";
61 mainProgram = "ratchet";
62 downloadPage = "https://github.com/sethvargo/ratchet";
63 homepage = "https://github.com/sethvargo/ratchet";
64 license = licenses.asl20;
65 maintainers = with maintainers; [