about summary refs log tree commit diff
path: root/pkgs/applications/version-management/gitprompt-rs/default.nix
blob: 4df54080513cd9a175e2c55438af721f5f2694ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  lib,
  fetchFromGitHub,
  rustPlatform,
  git,
}:
rustPlatform.buildRustPackage rec {
  pname = "gitprompt-rs";
  version = "0.3.0";

  src = fetchFromGitHub {
    owner = "9ary";
    repo = pname;
    rev = version;
    hash = "sha256-BqI3LbG7I/0wjzJaP8bxRwTM56joLqVaQCmAydX5vQM=";
  };

  cargoHash = "sha256-KBBdhiXEZz1/w6Zr/LogyceBdCn1ebfkVgGbtcdAeis=";

  postPatch = ''
    substituteInPlace src/main.rs \
      --replace 'Command::new("git")' 'Command::new("${git}/bin/git")'
  '';

  meta = with lib; {
    description = "Simple Git prompt";
    homepage = "https://github.com/9ary/gitprompt-rs";
    license = with licenses; [ mpl20 ];
    maintainers = with maintainers; [ isabelroses cafkafk ];
    mainProgram = "gitprompt-rs";
  };
}