From d3b4456e490fb09a1207850c8f30e31b2eb1ed3f Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 1 May 2026 02:29:12 +0000 Subject: [PATCH] switch-to-configuration: don't fail if `LOCALE_ARCHIVE` isn't present the code removed here amounted to ``` env::set_var("LOCALE_ARCHIVE", env::var("LOCALE_ARCHIVE")); ``` it has no effect, other than to cause a failure if `LOCALE_ARCHIVE` wasn't in the ambient environment. yet the explicit `is_empty()` check -- despite being a no-op -- suggests that it didn't intend for this to be an error. --- pkgs/by-name/sw/switch-to-configuration-ng/src/main.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/by-name/sw/switch-to-configuration-ng/src/main.rs b/pkgs/by-name/sw/switch-to-configuration-ng/src/main.rs index f084f27b9ae2..6984a4be9633 100644 --- a/pkgs/by-name/sw/switch-to-configuration-ng/src/main.rs +++ b/pkgs/by-name/sw/switch-to-configuration-ng/src/main.rs @@ -1566,7 +1566,6 @@ fn do_system_switch(action: Action) -> anyhow::Result<()> { let distro_id = required_env("DISTRO_ID")?; let pre_switch_check = required_env("PRE_SWITCH_CHECK")?; let install_bootloader = required_env("INSTALL_BOOTLOADER")?; - let locale_archive = required_env("LOCALE_ARCHIVE")?; let new_systemd = PathBuf::from(required_env("SYSTEMD")?); let log_level = if std::env::var("STC_DEBUG").is_ok() { LevelFilter::Debug @@ -1581,11 +1580,6 @@ fn do_system_switch(action: Action) -> anyhow::Result<()> { // environment variable from now on std::env::set_var("NIXOS_ACTION", Into::<&'static str>::into(action)); - // Expose the locale archive as an environment variable for systemctl and the activation script - if !locale_archive.is_empty() { - std::env::set_var("LOCALE_ARCHIVE", locale_archive); - } - let os_release = parse_os_release().context("Failed to parse os-release")?; let distro_id_re = Regex::new(format!("^\"?{distro_id}\"?$").as_str())