From dd8b0fcf527fa33e5dfe71b589ccb1044412bfad Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 16 Feb 2014 22:34:45 +0100 Subject: [PATCH] vm/windows: Save envirenoment before running VM. Later, when we start the actual builder, we're going to restore those environment variables. We're using "(set; declare -p)", here, because the former is just printing _all_ environment variables, even those not supported, and the latter only lists specifically declared variables, which also encludes exports. The "declare -p" command also emits those variables in a format similar to the "export" command. Signed-off-by: aszlig --- pkgs/build-support/vm/windows/controller/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/build-support/vm/windows/controller/default.nix b/pkgs/build-support/vm/windows/controller/default.nix index fd6ad6354aa..4a3e88a22c6 100644 --- a/pkgs/build-support/vm/windows/controller/default.nix +++ b/pkgs/build-support/vm/windows/controller/default.nix @@ -172,7 +172,9 @@ let }); preVM = '' + (set; declare -p) > saved-env XCHG_DIR="$(${coreutils}/bin/mktemp -d nix-vm.XXXXXXXXXX --tmpdir)" + ${coreutils}/bin/mv saved-env "$XCHG_DIR/" QEMU_VDE_SOCKET="$(pwd)/vde.ctl" MONITOR_SOCKET="$(pwd)/monitor" ${vde2}/bin/vde_switch -s "$QEMU_VDE_SOCKET" &