shell: using proxy implies populated target

This commit is contained in:
tv 2017-06-30 04:27:02 +02:00
parent b9c11e44e7
commit 849d0ba98f

View File

@ -64,11 +64,12 @@
export qtarget="$target_user@$target_host:$target_port$target_path"
if \test "''${using_proxy-}" != true; then
${init.env.populate}
if \test "$target_local" != true && \test "''${DISABLE_PROXY-}" != 1; then
if \test "$target_local" != true; then
exec ${init.env.proxy} "$command" "$@"
fi
fi
'' // {
parsetarget = pkgs.writeScript "init.env.parsetarget" /* sh */ ''
#! ${pkgs.dash}/bin/dash
@ -94,10 +95,6 @@
populate = pkgs.writeScript "init.env.populate" /* sh */ ''
#! ${pkgs.dash}/bin/dash
set -efu
if \test "''${DISABLE_POPULATE-}" = 1; then
exit
fi
set -x
${pkgs.nix}/bin/nix-instantiate \
--eval \
--json \
@ -125,8 +122,7 @@
config=$config \
system=$system \
target=$target \
DISABLE_POPULATE=1 \
DISABLE_PROXY=1 \
using_proxy=true \
"$*"
)
'';