Skip to content

Commit

Permalink
pass sys_info in nix_health's main
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaraj-bh committed Sep 13, 2023
1 parent f6a9905 commit a9784d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/nix_health/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
use anyhow::Context;
use colored::Colorize;
use nix_health::{report::Report, traits::Check, NixHealth};
use nix_rs::{command::NixCmd, info::NixInfo};
use nix_rs::{command::NixCmd, info::NixInfo, system::SysInfo};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
human_panic::setup_panic!();
let info = NixInfo::from_nix(&NixCmd::default())
let nix_info = NixInfo::from_nix(&NixCmd::default())
.await
.with_context(|| "Unable to gather nix info")?;
let health = NixHealth::check(&info);
let sys_info = SysInfo::get_info()
.await
.with_context(|| "Unable to gather system info")?;
let health = NixHealth::check(&nix_info, &sys_info);
println!("Checking the health of your Nix setup:\n");
for check in &health {
let report = check.report();
Expand Down

0 comments on commit a9784d9

Please sign in to comment.