Loading
nixos/power-management: Handle resume correctly with `sleep.target`
Fixes `nixos.tests.hibernate` nondeterministic failure. The documentation in `systemd.special(7)` recommends using this `StopWhenUnneeded` method, rather than using custom unit logic post-resume. This method is sufficiently general, and matches systemd's typical model of using `ExecStart` and `ExecStop` as duals that mirror each others processes across symmetric events in the system's life cycle, e.g. bootup / shutdown. This involved removing `post-resume.target`. This was introduced in d5604f0b as a way to notify services of resume events, but as discussed, this is not the typical model. See: https://github.com/NixOS/nixpkgs/pull/488429/changes#r3038005884