@@ -171,7 +171,7 @@ pub enum GetDeploymentDataError {
171
171
/// Evaluates the Nix in the given `repo` and return the processed Data from it
172
172
async fn get_deployment_data (
173
173
supports_flakes : bool ,
174
- flakes : & [ data:: DeployFlake < ' _ > ] ,
174
+ flakes : & [ data:: Target ] ,
175
175
extra_build_args : & [ String ] ,
176
176
) -> Result < Vec < settings:: Root > , GetDeploymentDataError > {
177
177
futures_util:: stream:: iter ( flakes) . then ( |flake| async move {
@@ -275,7 +275,7 @@ struct PromptPart<'a> {
275
275
276
276
fn print_deployment (
277
277
parts : & [ (
278
- & data:: DeployFlake < ' _ > ,
278
+ & data:: Target ,
279
279
data:: DeployData ,
280
280
data:: DeployDefs ,
281
281
) ] ,
@@ -318,7 +318,7 @@ pub enum PromptDeploymentError {
318
318
319
319
fn prompt_deployment (
320
320
parts : & [ (
321
- & data:: DeployFlake < ' _ > ,
321
+ & data:: Target ,
322
322
data:: DeployData ,
323
323
data:: DeployDefs ,
324
324
) ] ,
@@ -391,14 +391,14 @@ pub enum RunDeployError {
391
391
}
392
392
393
393
type ToDeploy < ' a > = Vec < (
394
- & ' a data:: DeployFlake < ' a > ,
394
+ & ' a data:: Target ,
395
395
& ' a settings:: Root ,
396
396
( & ' a str , & ' a settings:: Node ) ,
397
397
( & ' a str , & ' a settings:: Profile ) ,
398
398
) > ;
399
399
400
400
async fn run_deploy (
401
- deploy_flakes : Vec < data:: DeployFlake < ' _ > > ,
401
+ deploy_targets : Vec < data:: Target > ,
402
402
data : Vec < settings:: Root > ,
403
403
supports_flakes : bool ,
404
404
check_sigs : bool ,
@@ -412,11 +412,11 @@ async fn run_deploy(
412
412
log_dir : & Option < String > ,
413
413
rollback_succeeded : bool ,
414
414
) -> Result < ( ) , RunDeployError > {
415
- let to_deploy: ToDeploy = deploy_flakes
415
+ let to_deploy: ToDeploy = deploy_targets
416
416
. iter ( )
417
417
. zip ( & data)
418
- . map ( |( deploy_flake , data) | {
419
- let to_deploys: ToDeploy = match ( & deploy_flake . node , & deploy_flake . profile ) {
418
+ . map ( |( deploy_target , data) | {
419
+ let to_deploys: ToDeploy = match ( & deploy_target . node , & deploy_target . profile ) {
420
420
( Some ( node_name) , Some ( profile_name) ) => {
421
421
let node = match data. nodes . get ( node_name) {
422
422
Some ( x) => x,
@@ -428,7 +428,7 @@ async fn run_deploy(
428
428
} ;
429
429
430
430
vec ! [ (
431
- & deploy_flake ,
431
+ & deploy_target ,
432
432
& data,
433
433
( node_name. as_str( ) , node) ,
434
434
( profile_name. as_str( ) , profile) ,
@@ -464,7 +464,7 @@ async fn run_deploy(
464
464
465
465
profiles_list
466
466
. into_iter ( )
467
- . map ( |x| ( deploy_flake , data, ( node_name. as_str ( ) , node) , x) )
467
+ . map ( |x| ( deploy_target , data, ( node_name. as_str ( ) , node) , x) )
468
468
. collect ( )
469
469
}
470
470
( None , None ) => {
@@ -495,7 +495,7 @@ async fn run_deploy(
495
495
496
496
let ll: ToDeploy = profiles_list
497
497
. into_iter ( )
498
- . map ( |x| ( deploy_flake , data, ( node_name. as_str ( ) , node) , x) )
498
+ . map ( |x| ( deploy_target , data, ( node_name. as_str ( ) , node) , x) )
499
499
. collect ( ) ;
500
500
501
501
l. extend ( ll) ;
@@ -513,12 +513,12 @@ async fn run_deploy(
513
513
. collect ( ) ;
514
514
515
515
let mut parts: Vec < (
516
- & data:: DeployFlake < ' _ > ,
516
+ & data:: Target ,
517
517
data:: DeployData ,
518
518
data:: DeployDefs ,
519
519
) > = Vec :: new ( ) ;
520
520
521
- for ( deploy_flake , data, ( node_name, node) , ( profile_name, profile) ) in to_deploy {
521
+ for ( deploy_target , data, ( node_name, node) , ( profile_name, profile) ) in to_deploy {
522
522
let deploy_data = data:: make_deploy_data (
523
523
& data. generic_settings ,
524
524
node,
@@ -532,7 +532,7 @@ async fn run_deploy(
532
532
533
533
let deploy_defs = deploy_data. defs ( ) ?;
534
534
535
- parts. push ( ( deploy_flake , deploy_data, deploy_defs) ) ;
535
+ parts. push ( ( deploy_target , deploy_data, deploy_defs) ) ;
536
536
}
537
537
538
538
if interactive {
@@ -541,11 +541,11 @@ async fn run_deploy(
541
541
print_deployment ( & parts[ ..] ) ?;
542
542
}
543
543
544
- for ( deploy_flake , deploy_data, deploy_defs) in & parts {
544
+ for ( deploy_target , deploy_data, deploy_defs) in & parts {
545
545
deploy:: push:: push_profile ( deploy:: push:: PushProfileData {
546
546
supports_flakes,
547
547
check_sigs,
548
- repo : deploy_flake . repo ,
548
+ repo : & deploy_target . repo ,
549
549
deploy_data : & deploy_data,
550
550
deploy_defs : & deploy_defs,
551
551
keep_result,
@@ -600,7 +600,7 @@ pub enum RunError {
600
600
#[ error( "Failed to evaluate deployment data: {0}" ) ]
601
601
GetDeploymentData ( #[ from] GetDeploymentDataError ) ,
602
602
#[ error( "Error parsing flake: {0}" ) ]
603
- ParseFlake ( #[ from] data:: ParseFlakeError ) ,
603
+ ParseFlake ( #[ from] data:: ParseTargetError ) ,
604
604
#[ error( "Error initiating logger: {0}" ) ]
605
605
Logger ( #[ from] flexi_logger:: FlexiLoggerError ) ,
606
606
#[ error( "{0}" ) ]
@@ -624,10 +624,10 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> {
624
624
. targets
625
625
. unwrap_or_else ( || vec ! [ opts. clone( ) . target. unwrap_or( "." . to_string( ) ) ] ) ;
626
626
627
- let deploy_flakes : Vec < data:: DeployFlake > = deploys
628
- . iter ( )
629
- . map ( |f| data:: parse_flake ( f . as_str ( ) ) )
630
- . collect :: < Result < Vec < data:: DeployFlake > , data:: ParseFlakeError > > ( ) ?;
627
+ let deploy_targets : Vec < data:: Target > = deploys
628
+ . into_iter ( )
629
+ . map ( |f| f . parse :: < data:: Target > ( ) )
630
+ . collect :: < Result < Vec < data:: Target > , data:: ParseTargetError > > ( ) ?;
631
631
632
632
let cmd_overrides = data:: CmdOverrides {
633
633
ssh_user : opts. ssh_user ,
@@ -649,14 +649,14 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> {
649
649
}
650
650
651
651
if !opts. skip_checks {
652
- for deploy_flake in deploy_flakes . iter ( ) {
653
- check_deployment ( supports_flakes, deploy_flake . repo , & opts. extra_build_args ) . await ?;
652
+ for deploy_target in deploy_targets . iter ( ) {
653
+ check_deployment ( supports_flakes, & deploy_target . repo , & opts. extra_build_args ) . await ?;
654
654
}
655
655
}
656
656
let result_path = opts. result_path . as_deref ( ) ;
657
- let data = get_deployment_data ( supports_flakes, & deploy_flakes , & opts. extra_build_args ) . await ?;
657
+ let data = get_deployment_data ( supports_flakes, & deploy_targets , & opts. extra_build_args ) . await ?;
658
658
run_deploy (
659
- deploy_flakes ,
659
+ deploy_targets ,
660
660
data,
661
661
supports_flakes,
662
662
opts. checksigs ,
0 commit comments