starship: cleanup

This commit is contained in:
Pol Dellaiera
2025-04-27 21:55:07 +02:00
parent 215556684a
commit d2ea370197
+9 -13
View File
@@ -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;