switch-to-configuration-ng: prevent error during NIXOS_LUSTRATE install
This commit is contained in:
@@ -970,10 +970,6 @@ fn do_system_switch(action: Action) -> anyhow::Result<()> {
|
||||
std::env::set_var("LOCALE_ARCHIVE", locale_archive);
|
||||
}
|
||||
|
||||
let current_system_bin = std::path::PathBuf::from("/run/current-system/sw/bin")
|
||||
.canonicalize()
|
||||
.context("/run/current-system/sw/bin is missing")?;
|
||||
|
||||
let os_release = parse_os_release().context("Failed to parse os-release")?;
|
||||
|
||||
let distro_id_re = Regex::new(format!("^\"?{}\"?$", distro_id).as_str())
|
||||
@@ -1033,6 +1029,11 @@ fn do_system_switch(action: Action) -> anyhow::Result<()> {
|
||||
std::process::exit(0);
|
||||
}
|
||||
|
||||
// Needs to be after the "boot" action exits, as this directory will not exist when doing a NIXOS_LUSTRATE install
|
||||
let current_system_bin = std::path::PathBuf::from("/run/current-system/sw/bin")
|
||||
.canonicalize()
|
||||
.context("/run/current-system/sw/bin is missing")?;
|
||||
|
||||
let current_init_interface_version =
|
||||
std::fs::read_to_string("/run/current-system/init-interface-version").unwrap_or_default();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user