pacman.conf
All checks were successful
ci/woodpecker/push/build/1 Pipeline was successful
ci/woodpecker/push/build/2 Pipeline was successful

This commit is contained in:
JMARyA 2025-04-27 19:56:17 +02:00
parent 891eefd09a
commit 363daec873
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
3 changed files with 20 additions and 0 deletions

View file

@ -60,6 +60,9 @@ pkg = [
# Custom kernel
kernel = "linux-lts"
# Custom pacman.conf
pacman = "/etc/pacman.conf"
# Enable virtualization
virtualization = true

View file

@ -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)]

View file

@ -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();