navinstall/src/pkg.rs

37 lines
834 B
Rust
Raw Normal View History

2024-12-28 01:19:44 +01:00
use crate::{config::PackageConfig, install::str_vec, run_command};
2024-12-28 00:33:50 +01:00
2024-12-27 22:51:32 +01:00
pub const DESKTOP_PKG: [&str; 2] = ["plasma", "sddm"];
pub const SERVER_PKG: [&str; 1] = ["tmux"];
2024-12-28 00:33:50 +01:00
pub fn install_pkgs(pkg: &[&str]) {
let mut cmd = vec!["arch-chroot", "/mnt", "pacman", "-Syu"];
cmd.push("--noconfirm");
cmd.extend_from_slice(pkg);
run_command(&str_vec(cmd), None, true);
}
2024-12-28 01:19:44 +01:00
// PACSTRAP
pub fn pacstrap(conf: &PackageConfig) {
let mut cmd: Vec<String> = vec![
"pacstrap".into(),
"-K".into(),
"/mnt".into(),
"base".into(),
"linux".into(),
"linux-firmware".into(),
"linux-headers".into(),
"git".into(),
"networkmanager".into(),
"nano".into(),
"doas".into(),
];
cmd.extend(conf.pkg.clone());
run_command(&cmd, None, true);
}