From 58570e75d9bddede2a854b0f7cb8df7f1818c541 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 30 Nov 2024 12:55:35 +0100 Subject: [PATCH] runInLinuxVM: refactor vmRunCommand This makes it simpler to copy more files to xchg for the structuredAttrs case in the next commit. --- pkgs/build-support/vm/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index e204a2b195436..bb9c2c7368acb 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -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