nixos-rebuild-ng: pass the NIXOS_NO_CHECK variable through the systemd-run and sudo invocations

This allows to skip nixos pre-switch check when running switch-to-configuration.
This commit is contained in:
r-vdp
2025-12-30 16:40:24 +02:00
parent 12725fde0c
commit 15dc91ff95
2 changed files with 13 additions and 0 deletions
@@ -140,5 +140,16 @@
fi
'';
};
security =
let
extraConfig = ''
Defaults env_keep+=NIXOS_NO_CHECK
'';
in
{
sudo = { inherit extraConfig; };
sudo-rs = { inherit extraConfig; };
};
};
}
@@ -37,6 +37,8 @@ SWITCH_TO_CONFIGURATION_CMD_PREFIX: Final = [
"LOCALE_ARCHIVE",
"-E",
"NIXOS_INSTALL_BOOTLOADER",
"-E",
"NIXOS_NO_CHECK",
"--collect",
"--no-ask-password",
"--pipe",