system.preSwitchChecks
NixOS option
A set of shell script fragments that are executed before the switch to a new NixOS system configuration. A failure in any of these fragments will cause the switch to fail and exit early. The scripts receive the new configuration path and the action verb passed to switch-to-configuration, as the first and second positional arguments (meaning that you can access them using $1 and $2, respectively).
type: attribute set of stringDefault
{ }Example
declared in: nixos/modules/system/activation/pre-switch-check.nixView source on NixOS/nixpkgs →{ failsEveryTime =
''
false
'';
}