You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jade/src/main.rs

63 lines
2.0 KiB
Rust

mod args;
mod functions;
mod internal;
use crate::args::{BootloaderSubcommand, Command, Opt, UsersSubcommand};
use crate::functions::*;
use clap::Parser;
fn main() {
let opt: Opt = Opt::parse();
match opt.command {
Command::Partition(args) => {
partition::partition(args.device, args.mode, args.efi);
}
Command::InstallBase => {
base::install_base_packages();
}
Command::GenFstab => {
base::genfstab();
}
Command::SetupTimeshift => base::setup_timeshift(),
Command::Bootloader { subcommand } => match subcommand {
BootloaderSubcommand::GrubEfi { efidir } => {
base::install_bootloader_efi(efidir);
}
BootloaderSubcommand::GrubLegacy { device } => {
base::install_bootloader_legacy(device);
}
},
Command::Locale(args) => {
locale::set_locale(args.locales.join(" "));
locale::set_keyboard(&args.keyboard);
locale::set_timezone(&args.timezone);
}
Command::Networking(args) => {
if args.ipv6 {
network::create_hosts();
network::enable_ipv6()
} else {
network::create_hosts();
}
network::set_hostname(&args.hostname);
}
Command::Users { subcommand } => match subcommand {
UsersSubcommand::NewUser(args) => {
users::new_user(&args.username, args.hasroot, &args.password);
}
UsersSubcommand::RootPass { password } => {
users::root_pass(&password);
}
},
Command::Nix => {
base::install_homemgr();
}
Command::Config { config } => {
crate::internal::config::read_config(config);
}
Command::Desktops { desktop } => {
desktops::install_desktop_setup(desktop);
}
}
}