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
|
|
|
|
, fetchpatch
|
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";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "1.12.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-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-HS+vtF+h5M6lbk7TROAXwrHpj92SeC+j0TjmP6ycH2Q=";
|
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)
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
cargoHash = "sha256-hs0ImaozKH6QcUfts+oseUqecg7bGX5cx50ixnNamW8=";
|
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;
|
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
|
|
|
};
|
|
|
|
}
|