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-06-26 10:26:21 +00:00
|
|
|
version = "1.8.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "starship";
|
|
|
|
repo = pname;
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "v${version}";
|
2022-06-26 10:26:21 +00:00
|
|
|
sha256 = "sha256-+LfQ7ce8j7LBopV9bo+WjYcZCnwntOToKUHctPMaGXw=";
|
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-06-26 10:26:21 +00:00
|
|
|
cargoSha256 = "sha256-XPbirDdSDzIgsukkMYJrS/ghfF3VCplZ4BuOrzIRK0E=";
|
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
|
|
|
};
|
|
|
|
}
|