nixpkgs/pkgs/tools/misc/starship/default.nix
2022-11-04 17:55:53 -07:00

55 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, installShellFiles
, cmake
, fetchpatch
, nixosTests
, Security
, Foundation
, Cocoa
}:
rustPlatform.buildRustPackage rec {
pname = "starship";
version = "1.11.0";
src = fetchFromGitHub {
owner = "starship";
repo = pname;
rev = "v${version}";
hash = "sha256-90mh8C52uD68K5o1LE22gkbL1gy6FyMJTiiN9oV/3DE=";
};
nativeBuildInputs = [ installShellFiles cmake ];
buildInputs = lib.optionals stdenv.isDarwin [ Security Foundation Cocoa ];
NIX_LDFLAGS = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ "-framework" "AppKit" ];
postInstall = ''
installShellCompletion --cmd starship \
--bash <($out/bin/starship completions bash) \
--fish <($out/bin/starship completions fish) \
--zsh <($out/bin/starship completions zsh)
'';
cargoHash = "sha256-Q1VY9RyHEsQAWRN/upeG5XJxJfrmzj5FQG6GBGrN0xU=";
preCheck = ''
HOME=$TMPDIR
'';
passthru.tests = {
inherit (nixosTests) starship;
};
meta = with lib; {
description = "A minimal, blazing fast, and extremely customizable prompt for any shell";
homepage = "https://starship.rs";
license = licenses.isc;
maintainers = with maintainers; [ bbigras danth davidtwco Br1ght0ne Frostman marsam ];
};
}