diff --git a/nixos/modules/config/power-management.nix b/nixos/modules/config/power-management.nix index b061bbe6b707..5dcfe5bf013c 100644 --- a/nixos/modules/config/power-management.nix +++ b/nixos/modules/config/power-management.nix @@ -81,6 +81,21 @@ in serviceConfig.Type = "oneshot"; }; + systemd.services.post-boot = { + 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" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + script = '' + ${cfg.powerUpCommands} + ''; + }; + systemd.services.post-resume = { description = "Post-Resume Actions"; # Pulled in by post-resume.service above diff --git a/nixos/modules/system/activation/nixos-init.nix b/nixos/modules/system/activation/nixos-init.nix index 9d5094017c0b..1ab2e546d40a 100644 --- a/nixos/modules/system/activation/nixos-init.nix +++ b/nixos/modules/system/activation/nixos-init.nix @@ -58,10 +58,6 @@ in assertion = config.boot.postBootCommands == ""; message = "nixos-init cannot be used with boot.postBootCommands"; } - { - assertion = config.powerManagement.powerUpCommands == ""; - message = "nixos-init cannot be used with powerManagement.powerUpCommands"; - } ]; }) ]; diff --git a/nixos/modules/system/boot/stage-2.nix b/nixos/modules/system/boot/stage-2.nix index 680f5eed55c0..9b72391c20ac 100644 --- a/nixos/modules/system/boot/stage-2.nix +++ b/nixos/modules/system/boot/stage-2.nix @@ -30,7 +30,6 @@ let ); postBootCommands = pkgs.writeText "local-cmds" '' ${config.boot.postBootCommands} - ${config.powerManagement.powerUpCommands} ''; }; };