2022-07-30 07:13:09 +02:00
|
|
|
use clap::{ArgMatches, Command as ClapCommand};
|
2021-06-29 10:02:43 +02:00
|
|
|
|
2022-01-08 10:20:36 +01:00
|
|
|
use crate::error::ColmenaError;
|
2022-01-23 02:50:53 +01:00
|
|
|
use crate::nix::evaluator::nix_eval_jobs::get_pinned_nix_eval_jobs;
|
2022-07-30 07:13:09 +02:00
|
|
|
use crate::nix::NixCheck;
|
2021-06-29 10:02:43 +02:00
|
|
|
|
2022-10-09 23:26:37 +02:00
|
|
|
pub fn subcommand() -> ClapCommand {
|
2022-07-30 07:13:09 +02:00
|
|
|
ClapCommand::new("nix-info").about("Show information about the current Nix installation")
|
2021-06-29 10:02:43 +02:00
|
|
|
}
|
|
|
|
|
2022-01-08 10:20:36 +01:00
|
|
|
pub async fn run(_global_args: &ArgMatches, _local_args: &ArgMatches) -> Result<(), ColmenaError> {
|
2021-06-29 10:02:43 +02:00
|
|
|
let check = NixCheck::detect().await;
|
|
|
|
check.print_version_info();
|
|
|
|
check.print_flakes_info(false);
|
2021-11-18 22:15:20 +01:00
|
|
|
|
2022-01-23 02:50:53 +01:00
|
|
|
if let Some(pinned) = get_pinned_nix_eval_jobs() {
|
|
|
|
log::info!("Using pinned nix-eval-jobs: {}", pinned);
|
|
|
|
} else {
|
|
|
|
log::info!("Using nix-eval-jobs from PATH");
|
|
|
|
}
|
|
|
|
|
2021-11-18 22:15:20 +01:00
|
|
|
Ok(())
|
2021-06-29 10:02:43 +02:00
|
|
|
}
|