add-nuget-deps: set HOME outside of nix-shell

This commit is contained in:
David McFarland 2024-09-09 02:00:33 -03:00
parent 206693180f
commit a4189437a3
2 changed files with 6 additions and 4 deletions

View File

@ -82,11 +82,16 @@ attrs
in
writeShellScript "${finalPackage.name}-fetch-deps" ''
set -eu
export TMPDIR
TMPDIR=$(mktemp -d -t fetch-deps-${finalPackage.name}.XXXXXX)
trap 'chmod -R +w "$TMPDIR" && rm -fr "$TMPDIR"' EXIT
HOME=$TMPDIR/home
mkdir "$HOME"
cd "$TMPDIR"
NIX_BUILD_SHELL="${runtimeShell}" {nix}/bin/nix-shell \
NIX_BUILD_SHELL="${runtimeShell}" ${nix}/bin/nix-shell \
--pure --run 'source "${innerScript}"' "${drv}"
'';
};

View File

@ -1,8 +1,5 @@
set -e
HOME=$NIX_BUILD_TOP/home
mkdir "$HOME"
genericBuild
depsFile=$(realpath "${1:-@defaultDepsFile@}")