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