2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-10-07 09:15:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
|
|
|
, libiconv
|
2022-03-30 09:31:56 +00:00
|
|
|
, libgit2
|
|
|
|
, pkg-config
|
2022-01-13 20:06:32 +00:00
|
|
|
, nixosTests
|
2020-10-07 09:15:18 +00:00
|
|
|
, Security
|
2022-02-20 05:27:41 +00:00
|
|
|
, Foundation
|
2022-04-15 01:41:22 +00:00
|
|
|
, Cocoa
|
2020-10-07 09:15:18 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "starship";
|
2022-04-15 01:41:22 +00:00
|
|
|
# unstable was used for a quick fix for darwin
|
|
|
|
# revert to stable for the release after 1.5.4
|
|
|
|
version = "unstable-2022-04-12";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "starship";
|
|
|
|
repo = pname;
|
2022-04-15 01:41:22 +00:00
|
|
|
rev = "a02e87833d6a0e0da3c239d0bbbf3b485356a655";
|
|
|
|
sha256 = "sha256-oe/dKFgM8h+ur8E9/dw4byBl9vD6foUXyKX19HDozYU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
buildInputs = [ libgit2 ] ++ lib.optionals stdenv.isDarwin [ libiconv Security Foundation Cocoa ];
|
|
|
|
|
|
|
|
buildNoDefaultFeatures = true;
|
|
|
|
# the "notify" feature is currently broken on darwin
|
|
|
|
buildFeatures = if stdenv.isDarwin then [ "battery" ] else [ "default" ];
|
2021-12-06 16:07:01 +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
|
|
|
|
'';
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
cargoSha256 = "sha256-lku+K1Y5HIt4gDHqudhDMVs7XGoKw8HcMjXMGDu1vkg=";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
HOME=$TMPDIR
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) starship;
|
|
|
|
};
|
|
|
|
|
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;
|
2022-01-13 20:06:32 +00:00
|
|
|
maintainers = with maintainers; [ bbigras danth davidtwco Br1ght0ne Frostman marsam ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|