diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 82c61ba8462d..0a29ec630beb 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -293,6 +293,10 @@ let ${coreutils}/bin/cp $NIX_ATTRS_JSON_FILE $NIX_ATTRS_SH_FILE xchg source "$NIX_ATTRS_SH_FILE" fi + # The setup script is sourced here only so that `preVM` sees `$out` and + # friends. `postHook` belongs to the build inside the VM, where it may + # rely on the guest's tools (see `runInLinuxImage`), so skip it here. + postHook= source $stdenv/setup eval "$preVM"