summary refs log tree commit diff
path: root/nixos/modules/system/boot/modprobe.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/system/boot/modprobe.nix')
-rw-r--r--nixos/modules/system/boot/modprobe.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/modprobe.nix b/nixos/modules/system/boot/modprobe.nix
index c75f32c4d99..7426d148891 100644
--- a/nixos/modules/system/boot/modprobe.nix
+++ b/nixos/modules/system/boot/modprobe.nix
@@ -34,6 +34,23 @@ with lib;
       type = types.lines;
     };
 
+    boot.initrd.extraModprobeConfig = mkOption {
+      default = "";
+      example =
+        ''
+          options zfs zfs_arc_max=1073741824
+        '';
+      description = ''
+        Does exactly the same thing as
+        <option>boot.extraModprobeConfig</option>, except
+        that the generated <filename>modprobe.conf</filename>
+        file is also included in the initrd.
+        This is useful for setting module options for kernel
+        modules that are loaded during early boot in the initrd.
+      '';
+      type = types.lines;
+    };
+
   };
 
 
@@ -50,6 +67,9 @@ with lib;
         '')}
         ${config.boot.extraModprobeConfig}
       '';
+    environment.etc."modprobe.d/nixos-initrd.conf".text = ''
+        ${config.boot.initrd.extraModprobeConfig}
+      '';
     environment.etc."modprobe.d/debian.conf".source = pkgs.kmod-debian-aliases;
 
     environment.systemPackages = [ pkgs.kmod ];