use std::fs::File; use toml::value::{Array, Table}; use serde_derive::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Debug)] pub(crate) struct Config { pub(crate) base_package_path: String, pub(crate) installation_path: String, pub(crate) key_verification: bool } impl Default for Config { fn default() -> Self { Config { base_package_path: "/packages".to_string(), installation_path: "/var/gaypk/".to_string(), key_verification: true } } } pub(crate) fn read_config() -> Config { toml::from_str("/cfg/gaypk/config.toml").expect("Parse failed!") }