@@ -168,7 +168,7 @@ pub enum GetDeploymentDataError {
168
168
/// Evaluates the Nix in the given `repo` and return the processed Data from it
169
169
async fn get_deployment_data (
170
170
supports_flakes : bool ,
171
- flakes : & [ data:: DeployFlake < ' _ > ] ,
171
+ flakes : & [ data:: Target ] ,
172
172
extra_build_args : & [ String ] ,
173
173
) -> Result < Vec < settings:: Root > , GetDeploymentDataError > {
174
174
futures_util:: stream:: iter ( flakes) . then ( |flake| async move {
@@ -272,7 +272,7 @@ struct PromptPart<'a> {
272
272
273
273
fn print_deployment (
274
274
parts : & [ (
275
- & data:: DeployFlake < ' _ > ,
275
+ & data:: Target ,
276
276
data:: DeployData ,
277
277
data:: DeployDefs ,
278
278
) ] ,
@@ -315,7 +315,7 @@ pub enum PromptDeploymentError {
315
315
316
316
fn prompt_deployment (
317
317
parts : & [ (
318
- & data:: DeployFlake < ' _ > ,
318
+ & data:: Target ,
319
319
data:: DeployData ,
320
320
data:: DeployDefs ,
321
321
) ] ,
@@ -388,14 +388,14 @@ pub enum RunDeployError {
388
388
}
389
389
390
390
type ToDeploy < ' a > = Vec < (
391
- & ' a data:: DeployFlake < ' a > ,
391
+ & ' a data:: Target ,
392
392
& ' a settings:: Root ,
393
393
( & ' a str , & ' a settings:: Node ) ,
394
394
( & ' a str , & ' a settings:: Profile ) ,
395
395
) > ;
396
396
397
397
async fn run_deploy (
398
- deploy_flakes : Vec < data:: DeployFlake < ' _ > > ,
398
+ deploy_targets : Vec < data:: Target > ,
399
399
data : Vec < settings:: Root > ,
400
400
supports_flakes : bool ,
401
401
check_sigs : bool ,
@@ -409,11 +409,11 @@ async fn run_deploy(
409
409
log_dir : & Option < String > ,
410
410
rollback_succeeded : bool ,
411
411
) -> Result < ( ) , RunDeployError > {
412
- let to_deploy: ToDeploy = deploy_flakes
412
+ let to_deploy: ToDeploy = deploy_targets
413
413
. iter ( )
414
414
. zip ( & data)
415
- . map ( |( deploy_flake , data) | {
416
- let to_deploys: ToDeploy = match ( & deploy_flake . node , & deploy_flake . profile ) {
415
+ . map ( |( deploy_target , data) | {
416
+ let to_deploys: ToDeploy = match ( & deploy_target . node , & deploy_target . profile ) {
417
417
( Some ( node_name) , Some ( profile_name) ) => {
418
418
let node = match data. nodes . get ( node_name) {
419
419
Some ( x) => x,
@@ -425,7 +425,7 @@ async fn run_deploy(
425
425
} ;
426
426
427
427
vec ! [ (
428
- deploy_flake ,
428
+ deploy_target ,
429
429
data,
430
430
( node_name. as_str( ) , node) ,
431
431
( profile_name. as_str( ) , profile) ,
@@ -459,7 +459,7 @@ async fn run_deploy(
459
459
460
460
profiles_list
461
461
. into_iter ( )
462
- . map ( |x| ( deploy_flake , data, ( node_name. as_str ( ) , node) , x) )
462
+ . map ( |x| ( deploy_target , data, ( node_name. as_str ( ) , node) , x) )
463
463
. collect ( )
464
464
}
465
465
( None , None ) => {
@@ -490,7 +490,7 @@ async fn run_deploy(
490
490
491
491
let ll: ToDeploy = profiles_list
492
492
. into_iter ( )
493
- . map ( |x| ( deploy_flake , data, ( node_name. as_str ( ) , node) , x) )
493
+ . map ( |x| ( deploy_target , data, ( node_name. as_str ( ) , node) , x) )
494
494
. collect ( ) ;
495
495
496
496
l. extend ( ll) ;
@@ -508,12 +508,12 @@ async fn run_deploy(
508
508
. collect ( ) ;
509
509
510
510
let mut parts: Vec < (
511
- & data:: DeployFlake < ' _ > ,
511
+ & data:: Target ,
512
512
data:: DeployData ,
513
513
data:: DeployDefs ,
514
514
) > = Vec :: new ( ) ;
515
515
516
- for ( deploy_flake , data, ( node_name, node) , ( profile_name, profile) ) in to_deploy {
516
+ for ( deploy_target , data, ( node_name, node) , ( profile_name, profile) ) in to_deploy {
517
517
let deploy_data = data:: make_deploy_data (
518
518
& data. generic_settings ,
519
519
node,
@@ -527,7 +527,7 @@ async fn run_deploy(
527
527
528
528
let deploy_defs = deploy_data. defs ( ) ?;
529
529
530
- parts. push ( ( deploy_flake , deploy_data, deploy_defs) ) ;
530
+ parts. push ( ( deploy_target , deploy_data, deploy_defs) ) ;
531
531
}
532
532
533
533
if interactive {
@@ -536,11 +536,11 @@ async fn run_deploy(
536
536
print_deployment ( & parts[ ..] ) ?;
537
537
}
538
538
539
- for ( deploy_flake , deploy_data, deploy_defs) in & parts {
539
+ for ( deploy_target , deploy_data, deploy_defs) in & parts {
540
540
deploy:: push:: push_profile ( deploy:: push:: PushProfileData {
541
541
supports_flakes,
542
542
check_sigs,
543
- repo : deploy_flake . repo ,
543
+ repo : & deploy_target . repo ,
544
544
deploy_data,
545
545
deploy_defs,
546
546
keep_result,
@@ -595,7 +595,7 @@ pub enum RunError {
595
595
#[ error( "Failed to evaluate deployment data: {0}" ) ]
596
596
GetDeploymentData ( #[ from] GetDeploymentDataError ) ,
597
597
#[ error( "Error parsing flake: {0}" ) ]
598
- ParseFlake ( #[ from] data:: ParseFlakeError ) ,
598
+ ParseFlake ( #[ from] data:: ParseTargetError ) ,
599
599
#[ error( "Error initiating logger: {0}" ) ]
600
600
Logger ( #[ from] flexi_logger:: FlexiLoggerError ) ,
601
601
#[ error( "{0}" ) ]
@@ -619,10 +619,10 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> {
619
619
. targets
620
620
. unwrap_or_else ( || vec ! [ opts. clone( ) . target. unwrap_or_else( || "." . to_string( ) ) ] ) ;
621
621
622
- let deploy_flakes : Vec < data:: DeployFlake > = deploys
622
+ let deploy_targets : Vec < data:: Target > = deploys
623
623
. iter ( )
624
- . map ( |f| data:: parse_flake ( f . as_str ( ) ) )
625
- . collect :: < Result < Vec < data:: DeployFlake > , data:: ParseFlakeError > > ( ) ?;
624
+ . map ( |f| f . parse :: < data:: Target > ( ) )
625
+ . collect :: < Result < Vec < data:: Target > , data:: ParseTargetError > > ( ) ?;
626
626
627
627
let cmd_overrides = data:: CmdOverrides {
628
628
ssh_user : opts. ssh_user ,
@@ -644,14 +644,14 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> {
644
644
}
645
645
646
646
if !opts. skip_checks {
647
- for deploy_flake in & deploy_flakes {
648
- check_deployment ( supports_flakes, deploy_flake . repo , & opts. extra_build_args ) . await ?;
647
+ for deploy_target in deploy_targets . iter ( ) {
648
+ check_deployment ( supports_flakes, & deploy_target . repo , & opts. extra_build_args ) . await ?;
649
649
}
650
650
}
651
651
let result_path = opts. result_path . as_deref ( ) ;
652
- let data = get_deployment_data ( supports_flakes, & deploy_flakes , & opts. extra_build_args ) . await ?;
652
+ let data = get_deployment_data ( supports_flakes, & deploy_targets , & opts. extra_build_args ) . await ?;
653
653
run_deploy (
654
- deploy_flakes ,
654
+ deploy_targets ,
655
655
data,
656
656
supports_flakes,
657
657
opts. checksigs ,
0 commit comments