runInLinuxVM: refactor vmRunCommand

This makes it simpler to copy more files to xchg for the structuredAttrs
case in the next commit.
This commit is contained in:
Wolfgang Walther 2024-11-30 12:55:35 +01:00
parent 437e6dbbb0
commit 58570e75d9
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1

View File

@ -230,16 +230,15 @@ rec {
vmRunCommand = qemuCommand: writeText "vm-run" ''
export > saved-env
${coreutils}/bin/mkdir xchg
export > xchg/saved-env
PATH=${coreutils}/bin
if [ -f "''${NIX_ATTRS_SH_FILE-}" ]; then
source "$NIX_ATTRS_SH_FILE"
fi
source $stdenv/setup
PATH=${coreutils}/bin
mkdir xchg
mv saved-env xchg/
eval "$preVM"
if [ "$enableParallelBuilding" = 1 ]; then