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 13:40:27 +01:00
parent 437e6dbbb0
commit 58570e75d9
+4 -5
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