diff --git a/lib/make-disk-image.nix b/lib/make-disk-image.nix index 352141f9..0186d4aa 100644 --- a/lib/make-disk-image.nix +++ b/lib/make-disk-image.nix @@ -50,6 +50,7 @@ let ++ lib.optional ( lib.elem "zfs" cfg.extraRootModules || configSupportsZfs ) cfg.kernelPackages.${config.boot.zfs.package.kernelModuleAttribute} + ++ cfg.extraRootModulePackages ); } // lib.optionalAttrs (diskoLib.vmToolsSupportsCustomQemu lib) { diff --git a/module.nix b/module.nix index 24d2305a..bc03651f 100644 --- a/module.nix +++ b/module.nix @@ -72,6 +72,18 @@ in example = [ "bcachefs" ]; }; + extraRootModulePackages = lib.mkOption { + type = lib.types.listOf lib.types.package; + description = '' + extra kernel module packages to include in the disk image builder VM. + Useful when you need kernel modules that are not part of the main kernel package. + ''; + default = [ ]; + example = lib.literalExpression '' + [ config.boot.kernelPackages.bcachefs ] + ''; + }; + extraPostVM = lib.mkOption { type = lib.types.lines; description = ''