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.16";
15in
16rustPlatform.buildRustPackage {
17 inherit pname version;
18
19 src = fetchFromGitHub {
20 owner = "zurawiki";
21 repo = pname;
22 rev = "v${version}";
23 hash = "sha256-JhMkK2zw3VL9o7j8DJmjY/im+GyCjfV2TJI3GDo8T8c=";
24 };
25
26 cargoHash = "sha256-ye9MAfG3m24ofV95Kr+KTP4FEqfrsm3aTQ464hG9q08=";
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 mainProgram = "gptcommit";
43 homepage = "https://github.com/zurawiki/gptcommit";
44 license = with licenses; [ asl20 ];
45 maintainers = with maintainers; [ happysalada ];
46 platforms = with platforms; all;
47 };
48}
49