about summary refs log tree commit diff
path: root/perl/lib/Nix/SSH.pm
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-24T14·24+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-24T14·30+0200
commit17ef2346723b96080cc912da646df4f6424e83fa (patch)
tree5ab323de4bbb72f2a41734e17528c6610f45b992 /perl/lib/Nix/SSH.pm
parent7b351da680cad41623c3f9853ff2eea3cb8e3545 (diff)
Fix NIX_SSHOPTS
Closes #302.
Diffstat (limited to 'perl/lib/Nix/SSH.pm')
-rw-r--r--perl/lib/Nix/SSH.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/perl/lib/Nix/SSH.pm b/perl/lib/Nix/SSH.pm
index 76a20997590b..9e0c10beb0e0 100644
--- a/perl/lib/Nix/SSH.pm
+++ b/perl/lib/Nix/SSH.pm
@@ -6,12 +6,16 @@ use IPC::Open2;
 
 our @ISA = qw(Exporter);
 our @EXPORT = qw(
+  @globalSshOpts
   readN readInt readString readStrings
   writeInt writeString writeStrings
   connectToRemoteNix
 );
 
 
+our @globalSshOpts = split ' ', ($ENV{"NIX_SSHOPTS"} or "");
+
+
 sub readN {
     my ($bytes, $from) = @_;
     my $res = "";
@@ -82,7 +86,7 @@ sub connectToRemoteNix {
     # Start ‘nix-store --serve’ on the remote host.
     my ($from, $to);
     # FIXME: don't start a shell, start ssh directly.
-    my $pid = open2($from, $to, "exec ssh -x -a $sshHost @{$sshOpts} nix-store --serve --write $extraFlags");
+    my $pid = open2($from, $to, "exec ssh -x -a $sshHost @globalSshOpts @{$sshOpts} nix-store --serve --write $extraFlags");
 
     # Do the handshake.
     my $SERVE_MAGIC_1 = 0x390c9deb; # FIXME