refactor
This commit is contained in:
parent
12b2cf4a96
commit
33a8fed192
4 changed files with 17 additions and 12 deletions
|
@ -86,7 +86,7 @@ pub struct GeneralConfig {
|
|||
// Root password
|
||||
pub root_password: Option<String>,
|
||||
// Enable Bluetooth
|
||||
pub bluetooth: Option<bool>
|
||||
pub bluetooth: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
use crate::{linux::systemd_service_enable, pkg::install_pkgs};
|
||||
use crate::{linux::systemd_service_enable, pkg::install_pkgs, print_status};
|
||||
|
||||
/// Enable Bluetooth
|
||||
pub fn setup_bluetooth() {
|
||||
print_status("Setting up Bluetooth");
|
||||
install_pkgs(&["bluez", "bluez-utils"]);
|
||||
systemd_service_enable("bluetooth.service");
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ use virt::setup_virtualization;
|
|||
use yansi::{Color, Paint};
|
||||
use zram::setup_zram;
|
||||
|
||||
pub mod bluetooth;
|
||||
pub mod boot;
|
||||
pub mod desktop;
|
||||
pub mod docker;
|
||||
|
@ -34,7 +35,6 @@ pub mod ssh;
|
|||
pub mod user;
|
||||
pub mod virt;
|
||||
pub mod zram;
|
||||
pub mod bluetooth;
|
||||
|
||||
use crate::{
|
||||
config::InstallConfig,
|
||||
|
@ -132,11 +132,11 @@ pub fn install(conf: InstallConfig) {
|
|||
}
|
||||
|
||||
setup_zram();
|
||||
|
||||
|
||||
if conf.general.bluetooth.unwrap_or_default() {
|
||||
setup_bluetooth();
|
||||
}
|
||||
|
||||
|
||||
setup_mkinitcpio(&conf.drive);
|
||||
setup_secure_boot();
|
||||
|
||||
|
|
18
src/print.rs
18
src/print.rs
|
@ -58,11 +58,10 @@ pub fn print_config(conf: &InstallConfig) {
|
|||
conf.general.timezone
|
||||
));
|
||||
if conf.general.root_password.is_some() {
|
||||
general_info.add_str(format!(
|
||||
"🔑 {} {}",
|
||||
"Root Password".paint(Color::Yellow),
|
||||
"✔️".paint(Color::Green)
|
||||
));
|
||||
general_info.add_str(format!("🔑 Root Password {}", "✔️".paint(Color::Green)));
|
||||
}
|
||||
if conf.general.bluetooth.unwrap_or_default() {
|
||||
general_info.add_str(format!("🌀 Bluetooth {}", "✔️".paint(Color::Green)));
|
||||
}
|
||||
|
||||
root_info.add_tree("🔨 General", general_info);
|
||||
|
@ -79,7 +78,8 @@ pub fn print_config(conf: &InstallConfig) {
|
|||
|
||||
if !conf.pkg.pkg.is_empty() {
|
||||
pkg_info.add_str(format!(
|
||||
"📦 Additional packages: {}",
|
||||
"📦 {} {}",
|
||||
"Additional packages:".paint(Color::Yellow),
|
||||
conf.pkg.pkg.join(" ")
|
||||
));
|
||||
}
|
||||
|
@ -145,7 +145,11 @@ pub fn print_config(conf: &InstallConfig) {
|
|||
}
|
||||
|
||||
if let Some(models) = &ai_conf.models {
|
||||
ai_info.add_str(format!("⬇️ Pull Models: {}", models.join(", ")));
|
||||
ai_info.add_str(format!(
|
||||
"⬇️ {} {}",
|
||||
"Pull Models:".paint(Color::Yellow),
|
||||
models.join(", ")
|
||||
));
|
||||
}
|
||||
|
||||
root_info.add_tree("🦙 Ollama", ai_info);
|
||||
|
|
Loading…
Add table
Reference in a new issue