Skip to content

Commit 229a973

Browse files
nixos/stage-1: Add option for allowing missing modules
1 parent 5df4362 commit 229a973

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

nixos/modules/system/boot/kernel.nix

+5
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ in
223223
'';
224224
};
225225

226+
boot.initrd.allowMissingModules = mkEnableOption ''
227+
not including modules from `kernelModules` /
228+
`availableKernelModules` in initrd when the kernel doesn't have
229+
them'';
230+
226231
system.modulesTree = mkOption {
227232
type = types.listOf types.path;
228233
internal = true;

nixos/modules/system/boot/stage-1.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let
1818
rootModules = config.boot.initrd.availableKernelModules ++ config.boot.initrd.kernelModules;
1919
kernel = config.system.modulesTree;
2020
firmware = config.hardware.firmware;
21-
allowMissing = false;
21+
allowMissing = config.boot.initrd.allowMissingModules;
2222
};
2323

2424

nixos/modules/system/boot/systemd/initrd.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ let
104104
rootModules = config.boot.initrd.availableKernelModules ++ config.boot.initrd.kernelModules;
105105
kernel = config.system.modulesTree;
106106
firmware = config.hardware.firmware;
107-
allowMissing = false;
107+
allowMissing = config.boot.initrd.allowMissingModules;
108108
};
109109

110110
initrdBinEnv = pkgs.buildEnv {

0 commit comments

Comments
 (0)