summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 698d58e..0c6fc1b 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -21,6 +21,10 @@ pub struct GlobalConfig {
pub allow_external_binaries: bool,
#[serde(default = "default_parallel_downloads")]
pub parallel_downloads: usize,
+ #[serde(default = "default_arch")]
+ pub arch: String,
+ #[serde(default = "default_libc")]
+ pub libc: String,
}
impl Default for GlobalConfig {
@@ -30,6 +34,8 @@ impl Default for GlobalConfig {
strict_gpg: false,
allow_external_binaries: false,
parallel_downloads: default_parallel_downloads(),
+ arch: default_arch(),
+ libc: default_libc(),
}
}
}
@@ -37,6 +43,8 @@ impl Default for GlobalConfig {
fn default_ignore_speed() -> bool { false }
fn default_strict_gpg() -> bool { false }
fn default_parallel_downloads() -> usize { 4 }
+fn default_arch() -> String { std::env::consts::ARCH.to_string() }
+fn default_libc() -> String { "glibc".to_string() }
#[derive(Debug, Deserialize, Serialize, Default, Clone)]
pub struct Config {
@@ -69,6 +77,8 @@ impl Config {
lines.push(format!("ignore_speed = {}", self.global.ignore_speed));
lines.push(format!("strict_gpg = {}", self.global.strict_gpg));
lines.push(format!("parallel_downloads = {}", self.global.parallel_downloads));
+ lines.push(format!("arch = {}", self.global.arch));
+ lines.push(format!("libc = {}", self.global.libc));
lines.push(String::new());
for (name, repo) in &self.repositories {
lines.push(format!("[repositories.{}]", name));
@@ -94,6 +104,8 @@ impl Config {
"ignore_speed = false\n",
"strict_gpg = false\n",
"parallel_downloads = 4\n",
+ "arch = x86_64\n",
+ "libc = glibc\n",
"\n",
"[repositories.rorkos]\n",
"url = \"https://github.com/RorkOS/RorkOS_package\"\n",