Unverified Commit dfaa22e8 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

starship: cleanup (#402349)

parents c678a551 d2ea3701
Loading
Loading
Loading
Loading
+9 −13
Original line number Diff line number Diff line
@@ -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;