nixpkgs/pkgs/tools/misc/starship/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.3 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, installShellFiles
, cmake
, git
2021-12-24 11:24:29 +00:00
, nixosTests
, Security
2022-02-14 04:19:04 +00:00
, Foundation
2022-04-09 16:33:50 +00:00
, Cocoa
}:
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;
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
buildInputs = lib.optionals stdenv.isDarwin [ Security Foundation Cocoa ];
2019-08-16 17:12:52 +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 = ''
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=";
nativeCheckInputs = [ git ];
preCheck = ''
HOME=$TMPDIR
'';
2019-08-16 17:12:52 +00:00
2021-12-24 11:24:29 +00:00
passthru.tests = {
inherit (nixosTests) starship;
};
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
};
}