feat(config): support for setting the default entry to boot

This commit is contained in:
2025-10-24 21:19:38 -07:00
parent fbebedd66a
commit 734ff117db
6 changed files with 36 additions and 3 deletions

View File

@@ -22,6 +22,9 @@ pub struct RootConfiguration {
/// the configuration is the latest version.
#[serde(default = "latest_version")]
pub version: u32,
/// Default options for Sprout.
#[serde(default)]
pub defaults: DefaultsConfiguration,
/// Values to be inserted into the root sprout context.
#[serde(default)]
pub values: BTreeMap<String, String>,
@@ -59,6 +62,14 @@ pub struct RootConfiguration {
pub phases: PhasesConfiguration,
}
/// Default configuration for Sprout, used when the corresponding options are not specified.
#[derive(Serialize, Deserialize, Default, Clone)]
pub struct DefaultsConfiguration {
/// The entry to boot without showing the boot menu.
/// If not specified, a boot menu is shown.
pub entry: Option<String>,
}
fn latest_version() -> u32 {
LATEST_VERSION
}