nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 rustPlatform,
5 versionCheckHook,
6 nix-update-script,
7 git,
8}:
9let
10 version = "1.1.10";
11in
12rustPlatform.buildRustPackage {
13 pname = "committed";
14 inherit version;
15
16 src = fetchFromGitHub {
17 owner = "crate-ci";
18 repo = "committed";
19 tag = "v${version}";
20 hash = "sha256-shYfKpQl0hv9m/x9UuWFksdNB6mkeQPFPP16vGxUbVw=";
21 };
22
23 cargoHash = "sha256-CK/vYcxYXE/hEq1h9mgwrYyeS36hfiYC8WDJN9iNH6s=";
24
25 nativeCheckInputs = [
26 git
27 ];
28
29 # Ensure libgit2 can read user.name and user.email for `git_signature_default`.
30 # https://github.com/crate-ci/committed/blob/v1.1.5/crates/committed/tests/cmd.rs#L126
31 preCheck = ''
32 export HOME=$(mktemp -d)
33 git config --global user.name nobody
34 git config --global user.email no@where
35 '';
36
37 nativeInstallCheckInputs = [ versionCheckHook ];
38 doInstallCheck = true;
39
40 passthru = {
41 updateScript = nix-update-script { };
42 };
43
44 meta = {
45 homepage = "https://github.com/crate-ci/committed";
46 changelog = "https://github.com/crate-ci/committed/blob/v${version}/CHANGELOG.md";
47 description = "Nitpicking commit history since beabf39";
48 mainProgram = "committed";
49 license = [
50 lib.licenses.asl20 # or
51 lib.licenses.mit
52 ];
53 maintainers = [ lib.maintainers.pigeonf ];
54 };
55}