Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restartAfterPowerFailure breaks activation script #1236

Open
gnammix opened this issue Dec 25, 2024 · 3 comments
Open

restartAfterPowerFailure breaks activation script #1236

gnammix opened this issue Dec 25, 2024 · 3 comments

Comments

@gnammix
Copy link

gnammix commented Dec 25, 2024

Hello, seems like adding power.restartAfterPowerFailure=true on systems that do not support this option (i.e.: my M1 pro notebook) cause the activation script to stop (e.g.: not running home-manager activation).
This is silent, no error is reported when running darwin-rebuild.

sudo systemsetup -setRestartPowerFailure 'on'
Restart After Power Failure: Not supported on this machine.
@Samasaur1
Copy link
Contributor

I don't think this is something we can check against, because we don't know the Mac model that the configuration is being activated on. Additionally, I don't think we can just ignore errors with this command, because we want to catch other, real errors

@gnammix
Copy link
Author

gnammix commented Dec 26, 2024

The issue I see is that the failure during activation is not reported, everything seems "normal" from user standpoint but script execution stops. If i didn't knew other part of configuration were not being applied (home-manager) I would not have noticed it.
I don't totally agree that we cannot check against it, systemsetup invocation in the script could be if gated or at least we could avoid stopping completely and silently in case of failures; anyway I'm really not a nix expert so cannot elaborate on that.
Just documenting it in the options description could be also a viable solution.

@Samasaur1
Copy link
Contributor

I'm all for checking for this error in theory; I'm just not sure how to differentiate this (a configuration error) from any other error that systemsetup throws. I do agree that this should be mentioned in the option documentation — that should be a pretty simple PR if you'd like to tackle it. I also agree that errors during activation should be made very clear, though that's a more involved change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants