diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.rs | 6 | ||||
-rw-r--r-- | src/push.rs | 7 |
2 files changed, 10 insertions, 3 deletions
@@ -106,6 +106,9 @@ pub struct Opts { /// Prompt for sudo password during activation. #[clap(long)] interactive_sudo: Option<bool>, + /// Call nom (nix-output-monitor) when building the configuration. + #[clap(long)] + nom: bool, } /// Returns if the available Nix installation supports flakes @@ -424,6 +427,7 @@ async fn run_deploy( boot: bool, log_dir: &Option<String>, rollback_succeeded: bool, + use_nom: bool, ) -> Result<(), RunDeployError> { let to_deploy: ToDeploy = deploy_flakes .iter() @@ -581,6 +585,7 @@ async fn run_deploy( keep_result, result_path, extra_build_args, + use_nom, }, ) }; @@ -717,6 +722,7 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> { opts.boot, &opts.log_dir, opts.rollback_succeeded.unwrap_or(true), + opts.nom, ) .await?; diff --git a/src/push.rs b/src/push.rs index c800a98..2d34436 100644 --- a/src/push.rs +++ b/src/push.rs @@ -57,6 +57,7 @@ pub struct PushProfileData<'a> { pub keep_result: bool, pub result_path: Option<&'a str>, pub extra_build_args: &'a [String], + pub use_nom: bool, } pub async fn build_profile_locally(data: &PushProfileData<'_>, derivation_name: &str) -> Result<(), PushProfileError> { @@ -66,9 +67,9 @@ pub async fn build_profile_locally(data: &PushProfileData<'_>, derivation_name: ); let mut build_command = if data.supports_flakes { - Command::new("nix") + Command::new(if data.use_nom {"nom"} else {"nix"}) } else { - Command::new("nix-build") + Command::new(if data.use_nom {"nom-build"} else {"nix-build"}) }; if data.supports_flakes { @@ -184,7 +185,7 @@ pub async fn build_profile_remotely(data: &PushProfileData<'_>, derivation_name: a => return Err(PushProfileError::CopyExit(a)), }; - let mut build_command = Command::new("nix"); + let mut build_command = Command::new(if data.use_nom {"nom"} else {"nix"}); build_command .arg("build").arg(derivation_name) .arg("--eval-store").arg("auto") |