diff options
| author | gnammix <71704832+gnammix@users.noreply.github.com> | 2024-12-27 21:36:31 +0100 |
|---|---|---|
| committer | gnammix <71704832+gnammix@users.noreply.github.com> | 2024-12-27 21:36:31 +0100 |
| commit | 016b1608eec6c54cfaece96b63ec9d1a6cd4672b (patch) | |
| tree | 32a2fd0bb5de699825b79b512a75792295bc9e95 /modules/power | |
| parent | bc03f7818771a75716966ce8c23110b715eff2aa (diff) | |
power: restartAfterPowerFailure option is carried out in activation script only if supported
Minor documentation change
Diffstat (limited to 'modules/power')
| -rw-r--r-- | modules/power/default.nix | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/power/default.nix b/modules/power/default.nix index a99905f..e36a027 100644 --- a/modules/power/default.nix +++ b/modules/power/default.nix @@ -15,6 +15,8 @@ in default = null; description = '' Whether to restart the computer after a power failure. + + Option is not supported on all devices. ''; }; @@ -33,8 +35,10 @@ in echo "configuring power..." >&2 ${lib.optionalString (cfg.restartAfterPowerFailure != null) '' - systemsetup -setRestartPowerFailure \ - '${onOff cfg.restartAfterPowerFailure}' &> /dev/null + if ! systemsetup -getRestartPowerFailure | grep -q "Not supported"; then + systemsetup -setRestartPowerFailure \ + '${onOff cfg.restartAfterPowerFailure}' &> /dev/null + fi ''} ${lib.optionalString (cfg.restartAfterFreeze != null) '' |
