Good Evening,
About a month ago, I changed the default sleep implementation on my laptop to “suspend-then-hibernate”, which has drastically improved my battery life. However, I’m now running into problems when running nixos-rebuild if I don’t run from a clean reboot.
The error is as follows:
restarting sysinit-reactivation.target
reloading the following units: firewall.service, reload-systemd-vconsole-setup.service
the following new units were started: run-credentials-systemd\x2dtmpfiles\x2dresetup.service.mount, sysinit-reactivation.target, systemd-tmpfiles-resetup.service
warning: the following units failed: systemd-hibernate-clear.service
× systemd-hibernate-clear.service - Clear Stale Hibernate Storage Info
Loaded: loaded (/etc/systemd/system/systemd-hibernate-clear.service; enabled; preset: ignored)
Active: failed (Result: exit-code) since Thu 2024-11-07 23:26:06 GMT; 363ms ago
Invocation: 53deb1c7f66146d394cec96b6c5687ce
Docs: man:systemd-hibernate-clear.service(8)
Process: 180870 ExecStart=/nix/store/xg6f0c5pchmc2jq84s4np19j1rnn90mn-systemd-256.6/lib/systemd/systemd-hibernate-resume --clear (code=exited, status=1/FAILURE)
Main PID: 180870 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
Mem peak: 1.7M
CPU: 6ms
Nov 07 23:26:06 UnknownDevice systemd[1]: Starting Clear Stale Hibernate Storage Info...
Nov 07 23:26:06 UnknownDevice systemd-hibernate-resume[180870]: Failed to get EFI variable HibernateLocation: Input/output error
Nov 07 23:26:06 UnknownDevice systemd[1]: systemd-hibernate-clear.service: Main process exited, code=exited, status=1/FAILURE
Nov 07 23:26:06 UnknownDevice systemd[1]: systemd-hibernate-clear.service: Failed with result 'exit-code'.
Nov 07 23:26:06 UnknownDevice systemd[1]: Failed to start Clear Stale Hibernate Storage Info.
warning: error(s) occurred while switching to the new configuration
It seems that the hibernation resume is not properly clearing the efi variables, which nixos-rebuild must check before switching. How can I fix this?