diff --git a/config.example.toml b/config.example.toml index a952276c..a9e5846f 100644 --- a/config.example.toml +++ b/config.example.toml @@ -382,6 +382,12 @@ # (default: false) # include_release_notes = false +[doom] +# If this is set to true, the `--aot` flag is added to `doom upgrade`, +# which enables ahead-of-time native compilation of packages. +# (default: false) +# aot = true + [rustup] # If set, updates only these channels. # (default: [] (all channels)) diff --git a/src/config.rs b/src/config.rs index 8c79d11c..21e46e48 100644 --- a/src/config.rs +++ b/src/config.rs @@ -391,6 +391,12 @@ pub struct VscodeConfig { profile: Option, } +#[derive(Deserialize, Default, Debug, Merge)] +#[serde(deny_unknown_fields)] +pub struct DoomConfig { + aot: Option, +} + #[derive(Deserialize, Default, Debug, Merge)] #[serde(deny_unknown_fields)] pub struct Rustup { @@ -482,6 +488,9 @@ pub struct ConfigFile { #[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)] vscode: Option, + #[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)] + doom: Option, + #[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)] rustup: Option, } @@ -1772,6 +1781,14 @@ impl Config { Some(profile.as_str()) } } + + pub fn doom_aot(&self) -> bool { + self.config_file + .doom + .as_ref() + .and_then(|doom| doom.aot) + .unwrap_or(false) + } } #[cfg(test)] diff --git a/src/steps/emacs.rs b/src/steps/emacs.rs index 9d86aca4..0bf07928 100644 --- a/src/steps/emacs.rs +++ b/src/steps/emacs.rs @@ -65,7 +65,11 @@ impl Emacs { command.arg("--force"); } - command.args(["upgrade"]); + command.arg("upgrade"); + + if ctx.config().doom_aot() { + command.arg("--aot"); + } command.status_checked() }