summary refs log tree commit diff
path: root/pkgs/tools/misc/powerline-rs/default.nix
blob: 67f805988a3ed80a89da302d571fb6d02c3c9cb7 (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
{ stdenv, lib, rustPlatform, fetchFromGitHub, pkgconfig, file, perl, curl, cmake, openssl, libssh2, libgit2, libzip, Security }:
rustPlatform.buildRustPackage rec {
  pname = "powerline-rs";
  name = "${pname}-${version}";
  version = "0.1.8";

  src = fetchFromGitHub {
    owner = "jD91mZM2";
    repo = "powerline-rs";
    rev = version;

    sha256 = "018i9qq98afbgv0nxs1n83zb09lqhqxpdrd95f2maic3rr5ngnj5";
  };

  cargoSha256 = "184s432a6damzvl0lv6jar1iml9dq60r190aqjy44lcg938981zc";

  nativeBuildInputs = [ pkgconfig file perl cmake curl ];
  buildInputs = [ openssl libssh2 libgit2 libzip ] ++ lib.optional stdenv.isDarwin Security;

  postInstall = ''
    install -Dm 755 "${pname}.bash" "$out/etc/bash_completion.d/${pname}"
    install -Dm 755 "${pname}.fish" "$out/share/fish/vendor_completions.d/${pname}"
  '';

  meta = with lib; {
    description = "powerline-shell rewritten in Rust, inspired by powerline-go";
    license = licenses.mit;
    maintainers = with maintainers; [ jD91mZM2 ];
    platforms = platforms.unix;
  };
}