2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-10-07 09:15:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
2022-08-21 13:32:41 +00:00
|
|
|
, cmake
|
2023-01-20 10:41:00 +00:00
|
|
|
, git
|
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";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "1.16.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}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-CrD65nHE40n83HO+4QM1sLHvdFaqTvOb96hPBgXKuwk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles cmake ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security Foundation Cocoa ];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
NIX_LDFLAGS = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ "-framework" "AppKit" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postInstall = ''
|
2022-08-21 13:32:41 +00:00
|
|
|
installShellCompletion --cmd starship \
|
|
|
|
--bash <($out/bin/starship completions bash) \
|
|
|
|
--fish <($out/bin/starship completions fish) \
|
|
|
|
--zsh <($out/bin/starship completions zsh)
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
presetdir=$out/share/starship/presets/
|
|
|
|
mkdir -p $presetdir
|
|
|
|
cp docs/.vuepress/public/presets/toml/*.toml $presetdir
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
cargoHash = "sha256-ZHHrpepKZnSGufyEAjNDozaIKAt2GFRt+hU2ej7LceA=";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ git ];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
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;
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ danth davidtwco Br1ght0ne Frostman marsam ];
|
2023-08-10 07:59:29 +00:00
|
|
|
mainProgram = "starship";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|