use std::fmt::Display; use serde::Deserialize; /// Declarative install configuration #[derive(Debug, Clone, Deserialize)] pub struct InstallConfig { /// Drive Configuration pub drive: DriveConfig, /// General Configuration pub general: GeneralConfig, /// Package Configuration pub pkg: PackageConfig, /// User Configuration pub user: Option>, /// SSH Configuration pub ssh: Option, /// Ollama AI Config pub ai: Option, } #[derive(Debug, Clone, Deserialize)] pub struct OllamaConfig { pub models: Option>, pub gpu: bool, } #[derive(Debug, Clone, Deserialize)] pub struct SSHConfig { pub sshd_config: Option, pub key: Option>, } #[derive(Debug, Clone, Deserialize)] pub struct SSHKey { pub key: String, pub users: Vec, } #[derive(Debug, Clone, Deserialize)] pub struct UserConfig { pub name: String, pub password: String, pub doas_root: Option, pub docker: Option, } #[derive(Debug, Clone, Deserialize)] pub struct PackageConfig { /// Packages to install pub pkg: Vec, /// Enable libvirt pub virtualization: Option, /// Enable docker pub docker: Option, } #[derive(Debug, Clone, Deserialize)] pub struct DriveConfig { /// Boot Drive Path pub boot: String, /// Root Drive Path pub root: String, /// Enable encryption on root pub encryption: Option, } #[derive(Debug, Clone, Deserialize)] pub struct GeneralConfig { /// Presets pub mode: InstallMode, /// System locale pub locale: String, /// Keyboard Layout pub keyboard_layout: String, /// Keyboard Variant pub keyboard_variant: Option, /// Timezone pub timezone: String, /// Hostname pub hostname: String, // Root password pub root_password: Option, } #[derive(Debug, Clone, Deserialize)] pub enum InstallMode { /// Basic Arch Linux Installation Base, /// navOS Desktop Desktop, /// navOS Server Server, // TODO : Evaluate Kiosk, } impl Display for InstallMode { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { InstallMode::Base => f.write_str("Base")?, InstallMode::Desktop => f.write_str("Desktop")?, InstallMode::Server => f.write_str("Server")?, InstallMode::Kiosk => f.write_str("Kiosk")?, } Ok(()) } }