From 44448a0982cdfa136b93174f9a453190beb13ec2 Mon Sep 17 00:00:00 2001 From: shivaraj-bh Date: Wed, 13 Sep 2023 20:37:25 +0530 Subject: [PATCH] remove shivaraj; use rust style string --- crates/nix_health/src/check/trusted_users.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/nix_health/src/check/trusted_users.rs b/crates/nix_health/src/check/trusted_users.rs index bd7e932f..725413fe 100644 --- a/crates/nix_health/src/check/trusted_users.rs +++ b/crates/nix_health/src/check/trusted_users.rs @@ -37,15 +37,19 @@ impl Check for TrustedUsers { Report::Green } else if os == os_info::Type::NixOS { Report::Red(WithDetails { - msg: "$USER not present in trusted_users".into(), - suggestion: - "Add `nix.trustedUsers = [ \"root\" \"<$USER>\" ];` to your `configuration.nix`" - .into(), + msg: format!("{} not present in trusted_users", current_user), + suggestion: format!( + r#"Add `nix.trustedUsers = [ "root" "{}" ];` to your `configuration.nix`"#, + current_user + ), }) } else { Report::Red(WithDetails { - msg: "$USER not present in trusted_users".into(), - suggestion: "Run 'echo \"trusted-users = root $USER\" | sudo tee -a /etc/nix/nix.conf && sudo pkill nix-daemon'".into(), + msg: format!("{} not present in trusted_users", current_user), + suggestion: format!( + r#"Run 'echo "trusted-users = root {}" | sudo tee -a /etc/nix/nix.conf && sudo pkill nix-daemon'"#, + current_user + ), }) } }