Skip to content

Commit

Permalink
display instance for trusted_users; use ssr in system module
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaraj-bh committed Sep 13, 2023
1 parent 0e6330a commit f6a9905
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions crates/nix_health/src/check/trusted_users.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use nix_rs::{config::ConfigVal, info, system};

use std::fmt::Display;

use os_info;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -47,3 +50,9 @@ impl Check for TrustedUsers {
}
}
}

impl Display for TrustedUsers {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "trusted_users = {}", self.trusted_users.value.join(" "))
}
}
4 changes: 2 additions & 2 deletions crates/nix_rs/src/system.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Information about the user's system
use os_info;
use serde::{Deserialize, Serialize};
#[cfg(feature = "all")]
#[cfg(feature = "ssr")]
use std::env;

/// Information about the user's system
Expand All @@ -14,7 +14,7 @@ pub struct SysInfo {

impl SysInfo {
/// Determine [SysInfo] on the user's system
#[cfg(feature = "all")]
#[cfg(feature = "ssr")]
pub async fn get_info() -> Result<SysInfo, env::VarError> {
let current_user = env::var("USER")?;
let os = os_info::get().os_type();
Expand Down

0 comments on commit f6a9905

Please sign in to comment.