Power Management: Difference between revisions
Appearance
imported>Samueldr Created page with "{{expansion}} == Suspend == === Suspend hooks === NixOS provides the {{nixos:option|powerManagement.resumeCommands}} option which defines commands that are added to a globa..." |
(No difference)
|
Revision as of 19:30, 14 October 2017
☶︎
This article or section needs to be expanded. Further information may be found in the related discussion page. Please consult the pedia article metapage for guidelines on contributing.
Suspend
Suspend hooks
NixOS provides the powerManagement.resumeCommands
option which defines commands that are added to a global script that will be executed after resuming.
powerManagement.resumeCommands = ''
echo "This should show up in the journal after resuming."
'';
It is also possible, to use the post-resume
target directly to make a service.
Refer to the Systemd Services article for details about writing systemd services for NixOS.
systemd.services.your-service-name = {
description = "Service description here";
wantedBy = [ "post-resume.target" ];
after = [ "post-resume.target" ];
script = ''
echo "This should show up in the journal after resuming."
'';
serviceConfig.Type = "oneshot";
};