1{
2 lib,
3 fetchFromGitHub,
4 rustPlatform,
5 git,
6}:
7let
8 version = "0.4.1";
9in
10rustPlatform.buildRustPackage {
11 pname = "gitprompt-rs";
12 inherit version;
13
14 src = fetchFromGitHub {
15 owner = "9ary";
16 repo = "gitprompt-rs";
17 rev = version;
18 hash = "sha256-U0ylhgD86lbXvt6jMLaEQdL/zbcbXnfrA72FMEzBkN0=";
19 };
20
21 cargoHash = "sha256-1ihTH/Ft9/8wjRRR0Mt3m8AUYvUEARzdr+R77LjSxzY=";
22
23 postPatch = ''
24 substituteInPlace src/main.rs \
25 --replace 'Command::new("git")' 'Command::new("${git}/bin/git")'
26 '';
27
28 meta = {
29 description = "Simple Git prompt";
30 homepage = "https://github.com/9ary/gitprompt-rs";
31 license = lib.licenses.bsd0;
32 maintainers = with lib.maintainers; [
33 isabelroses
34 cafkafk
35 ];
36 mainProgram = "gitprompt-rs";
37 };
38}