90 lines
1.8 KiB
Rust
90 lines
1.8 KiB
Rust
use serde::Deserialize;
|
|
|
|
/// Declarative install configuration
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct InstallConfig {
|
|
/// Drive Configuration
|
|
pub drive: DriveConfig,
|
|
/// General Configuration
|
|
pub general: GeneralConfig,
|
|
/// Package Configuration
|
|
pub pkg: PackageConfig,
|
|
/// User Configuration
|
|
pub user: Vec<UserConfig>,
|
|
/// SSH Configuration
|
|
pub ssh: Option<SSHConfig>,
|
|
/// Ollama AI Config
|
|
pub ai: Option<OllamaConfig>
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct OllamaConfig {
|
|
pub models: Option<Vec<String>>,
|
|
pub gpu: bool
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct SSHConfig {
|
|
pub sshd_config: Option<String>,
|
|
pub key: Vec<SSHKey>,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct SSHKey {
|
|
pub key: String,
|
|
pub users: Vec<String>,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct UserConfig {
|
|
pub name: String,
|
|
pub password: String,
|
|
pub doas_root: bool,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct PackageConfig {
|
|
/// Packages to install
|
|
pub pkg: Vec<String>,
|
|
/// Enable libvirt
|
|
pub virtualization: bool,
|
|
/// Enable docker
|
|
pub docker: bool,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct DriveConfig {
|
|
/// Boot Drive Path
|
|
pub boot: String,
|
|
/// Root Drive Path
|
|
pub root: String,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct GeneralConfig {
|
|
/// Enable encryption on root
|
|
pub encryption: bool,
|
|
/// Presets
|
|
pub mode: InstallMode,
|
|
/// System locale
|
|
pub locale: String,
|
|
/// Keymap
|
|
pub keymap: String,
|
|
/// Timezone
|
|
pub timezone: String,
|
|
/// Hostname
|
|
pub hostname: String,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub enum InstallMode {
|
|
/// Basic Arch Linux Installation
|
|
Base,
|
|
/// navOS Desktop
|
|
Desktop,
|
|
/// navOS Server
|
|
Server,
|
|
|
|
// TODO : Evaluate
|
|
Kiosk,
|
|
}
|