bootstrap: impl default for config
This commit is contained in:
@ -2,7 +2,7 @@ use std::collections::BTreeMap as Map;
|
|||||||
|
|
||||||
pub const TAKE_ALL: i16 = -1;
|
pub const TAKE_ALL: i16 = -1;
|
||||||
|
|
||||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub anti_phishing_code: String,
|
pub anti_phishing_code: String,
|
||||||
|
|
||||||
@ -42,21 +42,11 @@ impl Config {
|
|||||||
pub fn new(bootstrap_dev: String) -> Self {
|
pub fn new(bootstrap_dev: String) -> Self {
|
||||||
Self {
|
Self {
|
||||||
anti_phishing_code: "Direktil<3".into(),
|
anti_phishing_code: "Direktil<3".into(),
|
||||||
keymap: None,
|
|
||||||
modules: None,
|
|
||||||
resolv_conf: None,
|
|
||||||
vpns: Map::new(),
|
|
||||||
networks: vec![],
|
|
||||||
auths: vec![],
|
|
||||||
ssh: Default::default(),
|
|
||||||
pre_lvm_crypt: vec![],
|
|
||||||
lvm: vec![],
|
|
||||||
crypt: vec![],
|
|
||||||
signer_public_key: None,
|
|
||||||
bootstrap: Bootstrap {
|
bootstrap: Bootstrap {
|
||||||
dev: bootstrap_dev,
|
dev: bootstrap_dev,
|
||||||
seed: None,
|
..Default::default()
|
||||||
},
|
},
|
||||||
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -244,7 +234,7 @@ pub struct Raid {
|
|||||||
pub stripes: Option<u8>,
|
pub stripes: Option<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)]
|
||||||
pub struct Bootstrap {
|
pub struct Bootstrap {
|
||||||
pub dev: String,
|
pub dev: String,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
|||||||
Reference in New Issue
Block a user