Commit afa7439 1 parent c84ccd0 commit afa7439 Copy full SHA for afa7439
File tree 4 files changed +21
-0
lines changed
4 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,13 @@ with builtins; rec {
208
208
type = types . listOf types . str ;
209
209
default = [ "sudo" "-H" "--" ] ;
210
210
} ;
211
+ sshOptions = lib . mkOption {
212
+ description = mdDoc ''
213
+ Extra SSH options to pass to the SSH command.
214
+ '' ;
215
+ type = types . listOf types . str ;
216
+ default = [ ] ;
217
+ } ;
211
218
} ;
212
219
} ;
213
220
} ;
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ pub struct Ssh {
33
33
/// Command to elevate privileges with.
34
34
privilege_escalation_command : Vec < String > ,
35
35
36
+ /// extra SSH options
37
+ extra_ssh_options : Vec < String > ,
38
+
36
39
/// Whether to use the experimental `nix copy` command.
37
40
use_nix3_copy : bool ,
38
41
@@ -189,6 +192,7 @@ impl Ssh {
189
192
port : None ,
190
193
ssh_config : None ,
191
194
privilege_escalation_command : Vec :: new ( ) ,
195
+ extra_ssh_options : Vec :: new ( ) ,
192
196
use_nix3_copy : false ,
193
197
job : None ,
194
198
}
@@ -206,6 +210,10 @@ impl Ssh {
206
210
self . privilege_escalation_command = command;
207
211
}
208
212
213
+ pub fn set_extra_ssh_options ( & mut self , options : Vec < String > ) {
214
+ self . extra_ssh_options = options;
215
+ }
216
+
209
217
pub fn set_use_nix3_copy ( & mut self , enable : bool ) {
210
218
self . use_nix3_copy = enable;
211
219
}
@@ -346,6 +354,7 @@ impl Ssh {
346
354
]
347
355
. iter ( )
348
356
. map ( |s| s. to_string ( ) )
357
+ . chain ( self . extra_ssh_options . clone ( ) )
349
358
. collect ( ) ;
350
359
351
360
if let Some ( port) = self . port {
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ pub struct NodeConfig {
78
78
#[ serde( rename = "privilegeEscalationCommand" ) ]
79
79
privilege_escalation_command : Vec < String > ,
80
80
81
+ #[ serde( rename = "sshOptions" ) ]
82
+ extra_ssh_options : Vec < String > ,
83
+
81
84
#[ validate( custom = "validate_keys" ) ]
82
85
keys : HashMap < String , Key > ,
83
86
}
@@ -181,6 +184,7 @@ impl NodeConfig {
181
184
self . target_host . as_ref ( ) . map ( |target_host| {
182
185
let mut host = Ssh :: new ( self . target_user . clone ( ) , target_host. clone ( ) ) ;
183
186
host. set_privilege_escalation_command ( self . privilege_escalation_command . clone ( ) ) ;
187
+ host. set_extra_ssh_options ( self . extra_ssh_options . clone ( ) ) ;
184
188
185
189
if let Some ( target_port) = self . target_port {
186
190
host. set_port ( target_port) ;
Original file line number Diff line number Diff line change @@ -248,6 +248,7 @@ mod tests {
248
248
build_on_target : false ,
249
249
replace_unknown_profiles : false ,
250
250
privilege_escalation_command : vec ! [ ] ,
251
+ extra_ssh_options : vec ! [ ] ,
251
252
keys : HashMap :: new ( ) ,
252
253
} ;
253
254
You can’t perform that action at this time.
0 commit comments