about summary refs log tree commit diff
path: root/pkgs/by-name/gi/gitprompt-rs/package.nix
blob: b7b1987ae53aa08cf18a1965b40e78c4dedab316 (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
33
34
35
36
37
38
{
  lib,
  fetchFromGitHub,
  rustPlatform,
  git,
}:
let
  version = "0.3.0";
in
rustPlatform.buildRustPackage {
  pname = "gitprompt-rs";
  inherit version;

  src = fetchFromGitHub {
    owner = "9ary";
    repo = "gitprompt-rs";
    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 = {
    description = "Simple Git prompt";
    homepage = "https://github.com/9ary/gitprompt-rs";
    license = lib.licenses.mpl20;
    maintainers = with lib.maintainers; [
      isabelroses
      cafkafk
    ];
    mainProgram = "gitprompt-rs";
  };
}