diff --git a/pkgs/tools/misc/starship/default.nix b/pkgs/by-name/st/starship/package.nix similarity index 56% rename from pkgs/tools/misc/starship/default.nix rename to pkgs/by-name/st/starship/package.nix index 094be04ce9a3..22feec90455b 100644 --- a/pkgs/tools/misc/starship/default.nix +++ b/pkgs/by-name/st/starship/package.nix @@ -5,21 +5,20 @@ rustPlatform, installShellFiles, cmake, + writableTmpDirAsHomeHook, git, nixosTests, - Security, - Foundation, - Cocoa, + buildPackages, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "starship"; version = "1.22.1"; src = fetchFromGitHub { owner = "starship"; repo = "starship"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-YoLi4wxBK9TFTtZRm+2N8HO5ZiC3V2GMqKFKKLHq++s="; }; @@ -28,16 +27,7 @@ rustPlatform.buildRustPackage rec { cmake ]; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - Security - Foundation - Cocoa - ]; - - NIX_LDFLAGS = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - "-framework" - "AppKit" - ]; + buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ writableTmpDirAsHomeHook ]; # tries to access HOME only in aarch64-darwin environment when building mac-notification-sys preBuild = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' @@ -50,12 +40,17 @@ rustPlatform.buildRustPackage rec { mkdir -p $presetdir cp docs/public/presets/toml/*.toml $presetdir '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd starship \ - --bash <($out/bin/starship completions bash) \ - --fish <($out/bin/starship completions fish) \ - --zsh <($out/bin/starship completions zsh) - ''; + + 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) + '' + ); useFetchCargoVendor = true; cargoHash = "sha256-B2CCrSH2aTcGEX96oBxl/27hNMdDpdd2vxdt0/nlN6I="; @@ -70,15 +65,18 @@ rustPlatform.buildRustPackage rec { inherit (nixosTests) starship; }; - meta = with lib; { + meta = { description = "Minimal, blazing fast, and extremely customizable prompt for any shell"; homepage = "https://starship.rs"; - license = licenses.isc; - maintainers = with maintainers; [ + 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 ]; mainProgram = "starship"; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 48b18c7615db..914f615c134c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13567,10 +13567,6 @@ with pkgs; version = "4.300"; }; - starship = callPackage ../tools/misc/starship { - inherit (darwin.apple_sdk.frameworks) Security Foundation Cocoa; - }; - inherit (callPackages ../data/fonts/gdouros { }) aegan aegyptus