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 <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2014-02-16 22:34:45 +01:00
parent 707b7ad1bd
commit dd8b0fcf52
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -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" &