Files
nixpkgs/pkgs/by-name/st/starship/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

74 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
installShellFiles,
writableTmpDirAsHomeHook,
gitMinimal,
nixosTests,
buildPackages,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "starship";
version = "1.23.0";
src = fetchFromGitHub {
owner = "starship";
repo = "starship";
tag = "v${finalAttrs.version}";
hash = "sha256-5Euhbuu1uiJ5HJNlPs9sUoGcc5QWqXqNmEH0jpfGLlc=";
};
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
writableTmpDirAsHomeHook
];
postInstall = ''
presetdir=$out/share/starship/presets/
mkdir -p $presetdir
cp docs/public/presets/toml/*.toml $presetdir
''
+ lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
let
emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
installShellCompletion --cmd starship \
--bash <(${emulator} $out/bin/starship completions bash) \
--fish <(${emulator} $out/bin/starship completions fish) \
--zsh <(${emulator} $out/bin/starship completions zsh)
''
);
cargoHash = "sha256-cxDWaPlNK7POJ3GhA21NlJ6q62bqHdA/4sru5pLkvOA=";
nativeCheckInputs = [
gitMinimal
writableTmpDirAsHomeHook
];
passthru.tests = {
inherit (nixosTests) starship;
};
meta = {
description = "Minimal, blazing fast, and extremely customizable prompt for any shell";
homepage = "https://starship.rs";
downloadPage = "https://github.com/starship/starship";
changelog = "https://github.com/starship/starship/releases/tag/v${finalAttrs.version}";
license = lib.licenses.isc;
maintainers = with lib.maintainers; [
danth
Br1ght0ne
Frostman
awwpotato
sigmasquadron
];
mainProgram = "starship";
};
})