2021-01-29 05:20:00 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-09-30 01:00:00 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
2022-08-14 06:20:00 +02:00
|
|
|
, cmake
|
|
|
|
, fetchpatch
|
2021-12-24 12:24:29 +01:00
|
|
|
, nixosTests
|
2020-09-30 01:00:00 +02:00
|
|
|
, Security
|
2022-02-14 05:19:04 +01:00
|
|
|
, Foundation
|
2022-04-09 18:33:50 +02:00
|
|
|
, Cocoa
|
2020-09-30 01:00:00 +02:00
|
|
|
}:
|
2019-08-16 19:12:52 +02:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "starship";
|
2022-10-15 08:47:00 +02:00
|
|
|
version = "1.11.0";
|
2019-08-16 19:12:52 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "starship";
|
2019-12-03 18:10:30 +01:00
|
|
|
repo = pname;
|
2022-04-15 06:20:00 +02:00
|
|
|
rev = "v${version}";
|
2022-09-27 10:10:54 +02:00
|
|
|
hash = "sha256-90mh8C52uD68K5o1LE22gkbL1gy6FyMJTiiN9oV/3DE=";
|
2019-08-16 19:12:52 +02:00
|
|
|
};
|
|
|
|
|
2022-08-15 21:14:44 +02:00
|
|
|
nativeBuildInputs = [ installShellFiles cmake ];
|
2020-03-22 10:20:00 +01:00
|
|
|
|
2022-09-27 10:10:54 +02:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security Foundation Cocoa ];
|
2019-08-16 19:12:52 +02:00
|
|
|
|
2022-09-27 10:10:54 +02:00
|
|
|
NIX_LDFLAGS = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ "-framework" "AppKit" ];
|
2022-04-14 00:58:31 +02:00
|
|
|
|
2020-06-26 11:20:00 +02:00
|
|
|
postInstall = ''
|
2022-08-14 06:20:00 +02: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 11:20:00 +02:00
|
|
|
'';
|
|
|
|
|
2022-09-27 10:10:54 +02:00
|
|
|
cargoHash = "sha256-Q1VY9RyHEsQAWRN/upeG5XJxJfrmzj5FQG6GBGrN0xU=";
|
2021-01-29 05:20:00 +01:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
HOME=$TMPDIR
|
|
|
|
'';
|
2019-08-16 19:12:52 +02:00
|
|
|
|
2021-12-24 12:24:29 +01:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) starship;
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-08-16 19:12:52 +02:00
|
|
|
description = "A minimal, blazing fast, and extremely customizable prompt for any shell";
|
|
|
|
homepage = "https://starship.rs";
|
|
|
|
license = licenses.isc;
|
2021-12-23 23:22:39 +01:00
|
|
|
maintainers = with maintainers; [ bbigras danth davidtwco Br1ght0ne Frostman marsam ];
|
2019-08-16 19:12:52 +02:00
|
|
|
};
|
|
|
|
}
|