Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@
# Extra Home Manager arguments
# home_manager_arguments = ["--flake", "file"]

# subcommand to use for apt variants != nala (dist-upgrade (default) or upgrade)
# apt_command = "dist-upgrade"

[git]
# How many repos to pull at max in parallel
Expand Down
10 changes: 10 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ pub struct Linux {
nix_env_arguments: Option<String>,

#[merge(strategy = crate::utils::merge_strategies::string_append_opt)]
apt_command: Option<String>,
apt_arguments: Option<String>,

enable_tlmgr: Option<bool>,
Expand Down Expand Up @@ -1228,6 +1229,15 @@ impl Config {
.unwrap_or("")
}

/// apt command: upgrade or dist-upgrade
pub fn apt_command(&self) -> &str {
self.config_file
.linux
.as_ref()
.and_then(|linux| linux.apt_command.as_deref())
.unwrap_or("dist-upgrade")
}

/// Extra apt arguments
pub fn apt_arguments(&self) -> Option<&str> {
self.config_file
Expand Down
3 changes: 2 additions & 1 deletion src/steps/os/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ fn upgrade_debian(ctx: &ExecutionContext) -> Result<()> {
if is_nala {
command.arg("upgrade");
} else {
command.arg("dist-upgrade");
let apt_command = ctx.config().apt_command();
command.arg(apt_command);
};
if ctx.config().yes(Step::System) {
command.arg("-y");
Expand Down