Merge pull request #240651 from accelbread/postresumecommands
nixos/boot: add postResumeCommands option
This commit is contained in:
commit
2f73652c34
3 changed files with 12 additions and 1 deletions
|
@ -495,6 +495,8 @@ if test -e /sys/power/resume -a -e /sys/power/disk; then
|
|||
fi
|
||||
fi
|
||||
|
||||
@postResumeCommands@
|
||||
|
||||
# If we have a path to an iso file, find the iso and link it to /dev/root
|
||||
if [ -n "$isoPath" ]; then
|
||||
mkdir -p /findiso
|
||||
|
|
|
@ -316,7 +316,7 @@ let
|
|||
inherit (config.system.build) earlyMountScript;
|
||||
|
||||
inherit (config.boot.initrd) checkJournalingFS verbose
|
||||
preLVMCommands preDeviceCommands postDeviceCommands postMountCommands preFailCommands kernelModules;
|
||||
preLVMCommands preDeviceCommands postDeviceCommands postResumeCommands postMountCommands preFailCommands kernelModules;
|
||||
|
||||
resumeDevices = map (sd: if sd ? device then sd.device else "/dev/disk/by-label/${sd.label}")
|
||||
(filter (sd: hasPrefix "/dev/" sd.device && !sd.randomEncryption.enable
|
||||
|
@ -527,6 +527,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
boot.initrd.postResumeCommands = mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
description = lib.mdDoc ''
|
||||
Shell commands to be executed immediately after attempting to resume.
|
||||
'';
|
||||
};
|
||||
|
||||
boot.initrd.postMountCommands = mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
|
|
|
@ -358,6 +358,7 @@ in {
|
|||
[ "preDeviceCommands" ]
|
||||
[ "preLVMCommands" ]
|
||||
[ "postDeviceCommands" ]
|
||||
[ "postResumeCommands" ]
|
||||
[ "postMountCommands" ]
|
||||
[ "extraUdevRulesCommands" ]
|
||||
[ "extraUtilsCommands" ]
|
||||
|
|
Loading…
Reference in a new issue