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
|
// Root password
|
||||||
pub root_password: Option<String>,
|
pub root_password: Option<String>,
|
||||||
// Enable Bluetooth
|
// Enable Bluetooth
|
||||||
pub bluetooth: Option<bool>
|
pub bluetooth: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[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
|
/// Enable Bluetooth
|
||||||
pub fn setup_bluetooth() {
|
pub fn setup_bluetooth() {
|
||||||
|
print_status("Setting up Bluetooth");
|
||||||
install_pkgs(&["bluez", "bluez-utils"]);
|
install_pkgs(&["bluez", "bluez-utils"]);
|
||||||
systemd_service_enable("bluetooth.service");
|
systemd_service_enable("bluetooth.service");
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ use virt::setup_virtualization;
|
||||||
use yansi::{Color, Paint};
|
use yansi::{Color, Paint};
|
||||||
use zram::setup_zram;
|
use zram::setup_zram;
|
||||||
|
|
||||||
|
pub mod bluetooth;
|
||||||
pub mod boot;
|
pub mod boot;
|
||||||
pub mod desktop;
|
pub mod desktop;
|
||||||
pub mod docker;
|
pub mod docker;
|
||||||
|
@ -34,7 +35,6 @@ pub mod ssh;
|
||||||
pub mod user;
|
pub mod user;
|
||||||
pub mod virt;
|
pub mod virt;
|
||||||
pub mod zram;
|
pub mod zram;
|
||||||
pub mod bluetooth;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config::InstallConfig,
|
config::InstallConfig,
|
||||||
|
|
18
src/print.rs
18
src/print.rs
|
@ -58,11 +58,10 @@ pub fn print_config(conf: &InstallConfig) {
|
||||||
conf.general.timezone
|
conf.general.timezone
|
||||||
));
|
));
|
||||||
if conf.general.root_password.is_some() {
|
if conf.general.root_password.is_some() {
|
||||||
general_info.add_str(format!(
|
general_info.add_str(format!("🔑 Root Password {}", "✔️".paint(Color::Green)));
|
||||||
"🔑 {} {}",
|
}
|
||||||
"Root Password".paint(Color::Yellow),
|
if conf.general.bluetooth.unwrap_or_default() {
|
||||||
"✔️".paint(Color::Green)
|
general_info.add_str(format!("🌀 Bluetooth {}", "✔️".paint(Color::Green)));
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
root_info.add_tree("🔨 General", general_info);
|
root_info.add_tree("🔨 General", general_info);
|
||||||
|
@ -79,7 +78,8 @@ pub fn print_config(conf: &InstallConfig) {
|
||||||
|
|
||||||
if !conf.pkg.pkg.is_empty() {
|
if !conf.pkg.pkg.is_empty() {
|
||||||
pkg_info.add_str(format!(
|
pkg_info.add_str(format!(
|
||||||
"📦 Additional packages: {}",
|
"📦 {} {}",
|
||||||
|
"Additional packages:".paint(Color::Yellow),
|
||||||
conf.pkg.pkg.join(" ")
|
conf.pkg.pkg.join(" ")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,11 @@ pub fn print_config(conf: &InstallConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(models) = &ai_conf.models {
|
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);
|
root_info.add_tree("🦙 Ollama", ai_info);
|
||||||
|
|
Loading…
Add table
Reference in a new issue