nixVersions: use writableTmpDirAsHomeHook in nix-fetchers-tests execution environment

(cherry picked from commit b21304fe4c491b871682fc292d9c31410cbb418a)
This commit is contained in:
Farid Zakaria
2025-08-30 06:23:07 -07:00
committed by Philip Taron
parent f6cbf3ec40
commit fe134e42ff
@@ -3,6 +3,7 @@
buildPackages,
stdenv,
mkMesonExecutable,
writableTmpDirAsHomeHook,
nix-fetchers,
nix-fetchers-c,
@@ -47,18 +48,13 @@ mkMesonExecutable (finalAttrs: {
runCommand "${finalAttrs.pname}-run"
{
meta.broken = !stdenv.hostPlatform.emulatorAvailable buildPackages;
buildInputs = [ writableTmpDirAsHomeHook ];
}
(
lib.optionalString stdenv.hostPlatform.isWindows ''
export HOME="$PWD/home-dir"
mkdir -p "$HOME"
''
+ ''
export _NIX_TEST_UNIT_DATA=${resolvePath ./data}
${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage}
touch $out
''
);
''
export _NIX_TEST_UNIT_DATA=${resolvePath ./data}
${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage}
touch $out
'';
};
};