From d2ea370197adf214ca04ac767977899b3091ec94 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 27 Apr 2025 21:50:10 +0200 Subject: [PATCH] starship: cleanup --- pkgs/by-name/st/starship/package.nix | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/st/starship/package.nix b/pkgs/by-name/st/starship/package.nix index 4505b2e7c754..404816b79a83 100644 --- a/pkgs/by-name/st/starship/package.nix +++ b/pkgs/by-name/st/starship/package.nix @@ -5,7 +5,7 @@ rustPlatform, installShellFiles, writableTmpDirAsHomeHook, - git, + gitMinimal, nixosTests, buildPackages, }: @@ -17,18 +17,15 @@ rustPlatform.buildRustPackage (finalAttrs: { src = fetchFromGitHub { owner = "starship"; repo = "starship"; - rev = "v${finalAttrs.version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-5Euhbuu1uiJ5HJNlPs9sUoGcc5QWqXqNmEH0jpfGLlc="; }; nativeBuildInputs = [ installShellFiles ]; - 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) '' - export HOME=$TMPDIR - ''; + buildInputs = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + writableTmpDirAsHomeHook + ]; postInstall = '' @@ -51,11 +48,10 @@ rustPlatform.buildRustPackage (finalAttrs: { useFetchCargoVendor = true; cargoHash = "sha256-cxDWaPlNK7POJ3GhA21NlJ6q62bqHdA/4sru5pLkvOA="; - nativeCheckInputs = [ git ]; - - preCheck = '' - HOME=$TMPDIR - ''; + nativeCheckInputs = [ + gitMinimal + writableTmpDirAsHomeHook + ]; passthru.tests = { inherit (nixosTests) starship;