liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit bcf5dac5d70b5b1eac5391cbef0e0c52ce9e56f9
parent 1c002c4065dde11fd552dea836d94dca0f081f43
Author: Daniel Barlow <dan@telent.net>
Date:   Sun,  7 May 2023 22:07:35 +0100

min-copy-closure: honour $SSH_COMMAND env var

Diffstat:
Mpkgs/min-copy-closure/min-copy-closure.sh | 16++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/pkgs/min-copy-closure/min-copy-closure.sh b/pkgs/min-copy-closure/min-copy-closure.sh @@ -1,13 +1,25 @@ #!/usr/bin/env bash +ssh_command=${SSH_COMMAND-ssh} target_host=$1 shift -paths=$(nix-store -q --requisites "$@") +if [ -z "$target_host" ] ; then + echo Usage: min-copy-closure target-host paths + exit 1 +fi + +if [ -n "$IN_NIX_BUILD" ] ; then + # can't run nix-store in a derivation, so we have to + # skip the requisites when running tests in hydra + paths=$@ +else + paths=$(nix-store -q --requisites "$@") +fi needed="" coproc remote { - ssh -C ${target_host} + ${ssh_command} -C -T ${target_host} } exec 10>&${remote[1]}