2021-01-29 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-09-29 23:00:00 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
2022-08-14 04:20:00 +00:00
|
|
|
, cmake
|
2023-01-05 00:27:36 +00:00
|
|
|
, git
|
2021-12-24 11:24:29 +00:00
|
|
|
, nixosTests
|
2020-09-29 23:00:00 +00:00
|
|
|
, Security
|
2022-02-14 04:19:04 +00:00
|
|
|
, Foundation
|
2022-04-09 16:33:50 +00:00
|
|
|
, Cocoa
|
2020-09-29 23:00:00 +00:00
|
|
|
}:
|
2019-08-16 17:12:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "starship";
|
2023-07-30 15:58:21 +00:00
|
|
|
version = "1.16.0";
|
2019-08-16 17:12:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "starship";
|
2019-12-03 17:10:30 +00:00
|
|
|
repo = pname;
|
2022-04-15 04:20:00 +00:00
|
|
|
rev = "v${version}";
|
2023-07-30 15:58:21 +00:00
|
|
|
hash = "sha256-CrD65nHE40n83HO+4QM1sLHvdFaqTvOb96hPBgXKuwk=";
|
2019-08-16 17:12:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-15 19:14:44 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles cmake ];
|
2020-03-22 09:20:00 +00:00
|
|
|
|
2022-09-27 08:10:54 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security Foundation Cocoa ];
|
2019-08-16 17:12:52 +00:00
|
|
|
|
2022-09-27 08:10:54 +00:00
|
|
|
NIX_LDFLAGS = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ "-framework" "AppKit" ];
|
2022-04-13 22:58:31 +00:00
|
|
|
|
2020-06-26 09:20:00 +00:00
|
|
|
postInstall = ''
|
2022-08-14 04:20:00 +00:00
|
|
|
installShellCompletion --cmd starship \
|
|
|
|
--bash <($out/bin/starship completions bash) \
|
|
|
|
--fish <($out/bin/starship completions fish) \
|
|
|
|
--zsh <($out/bin/starship completions zsh)
|
2020-06-26 09:20:00 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-30 15:58:21 +00:00
|
|
|
cargoHash = "sha256-ZHHrpepKZnSGufyEAjNDozaIKAt2GFRt+hU2ej7LceA=";
|
2021-01-29 04:20:00 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ git ];
|
2023-01-05 00:27:36 +00:00
|
|
|
|
2021-01-29 04:20:00 +00:00
|
|
|
preCheck = ''
|
|
|
|
HOME=$TMPDIR
|
|
|
|
'';
|
2019-08-16 17:12:52 +00:00
|
|
|
|
2021-12-24 11:24:29 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) starship;
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-08-16 17:12:52 +00:00
|
|
|
description = "A minimal, blazing fast, and extremely customizable prompt for any shell";
|
|
|
|
homepage = "https://starship.rs";
|
|
|
|
license = licenses.isc;
|
2021-12-23 22:22:39 +00:00
|
|
|
maintainers = with maintainers; [ bbigras danth davidtwco Br1ght0ne Frostman marsam ];
|
2023-08-04 22:11:04 +00:00
|
|
|
mainProgram = "starship";
|
2019-08-16 17:12:52 +00:00
|
|
|
};
|
|
|
|
}
|