nixos/power-management: deprecate powerUpCommands

Their ordering is ill-defined. Users are better off using an explicit systemd service.
This commit is contained in:
r-vdp
2026-02-10 12:15:58 +02:00
parent 34fd3fe6a2
commit df0b0d2f14
+14 -1
View File
@@ -62,6 +62,19 @@ in
config = lib.mkIf cfg.enable {
warnings = lib.optional (cfg.powerUpCommands != "") ''
powerManagement.powerUpCommands is deprecated due to it having unclear ordering semantics.
It will be removed in NixOS 26.11.
It is recommended to create an explicit systemd oneshot service instead,
that is pulled in at the right time during the boot process.
See https://www.freedesktop.org/software/systemd/man/latest/systemd.special.html
for more information on possible targets that can be used for this.
If you also want to run this service upon waking up from resume, the recommended
method to do so is described here:
https://www.freedesktop.org/software/systemd/man/latest/systemd.special.html#sleep.target
'';
systemd.targets.post-resume = {
description = "Post-Resume Actions";
requires = [ "post-resume.service" ];
@@ -85,8 +98,8 @@ in
description = "Post-boot Actions";
# It's not well defined at what point in the bootup sequence this should run
# we should eventually just remove this.
after = [ "multi-user.target" ];
wantedBy = [ "multi-user.target" ];
restartIfChanged = false;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;