2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-10-07 09:15:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
, installShellFiles
|
|
|
|
, libiconv
|
|
|
|
, Security
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "starship";
|
2021-08-27 14:25:00 +00:00
|
|
|
version = "0.57.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "starship";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-08-27 14:25:00 +00:00
|
|
|
sha256 = "sha256-cxTBK6eZTlqEaVfWYARQk6BjNuANy39eaXC6qFs/+6k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ] ++ lib.optionals stdenv.isLinux [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ openssl ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ libiconv Security ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postInstall = ''
|
|
|
|
for shell in bash fish zsh; do
|
2020-10-07 09:15:18 +00:00
|
|
|
STARSHIP_CACHE=$TMPDIR $out/bin/starship completions $shell > starship.$shell
|
2020-07-18 16:06:22 +00:00
|
|
|
installShellCompletion starship.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
cargoSha256 = "sha256-TFHRDgIxqJCkcSwpdbcx8vguKU1QuTyslmAsRznxt2s=";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
HOME=$TMPDIR
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A minimal, blazing fast, and extremely customizable prompt for any shell";
|
|
|
|
homepage = "https://starship.rs";
|
|
|
|
license = licenses.isc;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ bbigras davidtwco Br1ght0ne Frostman marsam ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|