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

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

55 lines
1.3 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, installShellFiles
, cmake
, fetchpatch
2021-12-24 12:24:29 +01:00
, nixosTests
, Security
2022-02-14 05:19:04 +01:00
, Foundation
2022-04-09 18:33:50 +02:00
, Cocoa
}:
2019-08-16 19:12:52 +02:00
rustPlatform.buildRustPackage rec {
pname = "starship";
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;
rev = "v${version}";
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
buildInputs = lib.optionals stdenv.isDarwin [ Security Foundation Cocoa ];
2019-08-16 19:12:52 +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 = ''
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
'';
cargoHash = "sha256-Q1VY9RyHEsQAWRN/upeG5XJxJfrmzj5FQG6GBGrN0xU=";
preCheck = ''
HOME=$TMPDIR
'';
2019-08-16 19:12:52 +02:00
2021-12-24 12:24:29 +01:00
passthru.tests = {
inherit (nixosTests) starship;
};
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
};
}