Merge pull request #240651 from accelbread/postresumecommands

nixos/boot: add postResumeCommands option

Changed files
+12 -1
nixos
modules
system
+2
nixos/modules/system/boot/stage-1-init.sh
···
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
+9 -1
nixos/modules/system/boot/stage-1.nix
···
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
···
Shell commands to be executed immediately after stage 1 of the
boot has loaded kernel modules and created device nodes in
{file}`/dev`.
+
'';
+
};
+
+
boot.initrd.postResumeCommands = mkOption {
+
default = "";
+
type = types.lines;
+
description = lib.mdDoc ''
+
Shell commands to be executed immediately after attempting to resume.
'';
};
+1
nixos/modules/system/boot/systemd/initrd.nix
···
[ "preDeviceCommands" ]
[ "preLVMCommands" ]
[ "postDeviceCommands" ]
+
[ "postResumeCommands" ]
[ "postMountCommands" ]
[ "extraUdevRulesCommands" ]
[ "extraUtilsCommands" ]