1{ stdenv
2, lib
3, fetchFromGitHub
4, rustPlatform
5, pkg-config
6, nix-update-script
7, Security
8, SystemConfiguration
9, openssl
10}:
11
12let
13 pname = "gptcommit";
14 version = "0.5.14";
15in
16rustPlatform.buildRustPackage {
17 inherit pname version;
18
19 src = fetchFromGitHub {
20 owner = "zurawiki";
21 repo = pname;
22 rev = "v${version}";
23 hash = "sha256-xjaFr1y2Fd7IWbJlegnIsfS5/oMJYd6QTnwp7IK17xM=";
24 };
25
26 cargoHash = "sha256-VZrlEJi/UPQTGFiSpZs+Do+69CY3zdqGkAnUxMYvvaw=";
27
28 nativeBuildInputs = [ pkg-config ];
29
30 # 0.5.6 release has failing tests
31 doCheck = false;
32
33 buildInputs = lib.optionals stdenv.isDarwin [ Security SystemConfiguration ]
34 ++ lib.optionals stdenv.isLinux [ openssl ];
35
36 passthru = {
37 updateScript = nix-update-script { };
38 };
39
40 meta = with lib; {
41 description = "A git prepare-commit-msg hook for authoring commit messages with GPT-3. ";
42 homepage = "https://github.com/zurawiki/gptcommit";
43 license = with licenses; [ asl20 ];
44 maintainers = with maintainers; [ happysalada ];
45 platforms = with platforms; all;
46 };
47}
48