✨ pacman.conf
This commit is contained in:
parent
891eefd09a
commit
363daec873
3 changed files with 20 additions and 0 deletions
|
@ -60,6 +60,9 @@ pkg = [
|
|||
# Custom kernel
|
||||
kernel = "linux-lts"
|
||||
|
||||
# Custom pacman.conf
|
||||
pacman = "/etc/pacman.conf"
|
||||
|
||||
# Enable virtualization
|
||||
virtualization = true
|
||||
|
||||
|
|
|
@ -61,6 +61,8 @@ pub struct PackageConfig {
|
|||
pub docker: Option<bool>,
|
||||
/// Custom kernel package
|
||||
pub kernel: Option<String>,
|
||||
/// Custom pacman.conf
|
||||
pub pacman: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
|
|
|
@ -127,9 +127,24 @@ pub fn install(mut conf: InstallConfig, bare: bool) {
|
|||
install_mnt(conf, bare);
|
||||
}
|
||||
|
||||
pub fn setup_pacman(dir: &str, conf: &str) {
|
||||
print_status("Installing pacman.conf");
|
||||
let dir = std::path::Path::new(dir);
|
||||
let content = std::fs::read_to_string(&conf).unwrap();
|
||||
std::fs::write(dir.join("etc").join("pacman.conf"), content).unwrap();
|
||||
}
|
||||
|
||||
pub fn install_mnt(conf: InstallConfig, bare: bool) {
|
||||
// Base Install
|
||||
pacstrap_at("/mnt", &conf.pkg.pkg);
|
||||
setup_pacman(
|
||||
"/mnt",
|
||||
&conf
|
||||
.pkg
|
||||
.pacman
|
||||
.clone()
|
||||
.unwrap_or("/etc/pacman.conf".to_string()),
|
||||
);
|
||||
setup_kernel(conf.pkg.kernel.clone());
|
||||
genfstab();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue