mirror of
https://github.com/nix-community/disko.git
synced 2024-09-11 06:25:33 +03:00
make-disk-image: allow kernel to be overriden by disko configuration
This is especially useful when trying to build images for embedded systems such as the pi, which have a vendor kernel that can't be booted as part of the disko image builder process
This commit is contained in:
parent
0d510fe40b
commit
f5cc4b55e5
@ -10,7 +10,7 @@ let
|
||||
vmTools = pkgs.vmTools.override {
|
||||
rootModules = [ "9p" "9pnet_virtio" "virtio_pci" "virtio_blk" ] ++ nixosConfig.config.disko.extraRootModules;
|
||||
kernel = pkgs.aggregateModules
|
||||
(with nixosConfig.config.boot.kernelPackages; [ kernel ]
|
||||
(with nixosConfig.config.disko.imageBuilderKernelPackages; [ kernel ]
|
||||
++ lib.optional (lib.elem "zfs" nixosConfig.config.disko.extraRootModules) zfs);
|
||||
};
|
||||
cleanedConfig = diskoLib.testLib.prepareDiskoConfig nixosConfig.config diskoLib.testLib.devices;
|
||||
|
11
module.nix
11
module.nix
@ -10,6 +10,17 @@ let
|
||||
in
|
||||
{
|
||||
options.disko = {
|
||||
imageBuilderKernel = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
imageBuilderKernelPackages = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
description = ''
|
||||
the kernel used when building disk images via make-disk-image.nix.
|
||||
Useful when the config's kernel won't boot in the image-builder.
|
||||
'';
|
||||
default = config.boot.kernelPackages;
|
||||
example = lib.literalExpression "pkgs.linuxPackages_testing";
|
||||
};
|
||||
extraRootModules = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = ''
|
||||
|
Loading…
Reference in New Issue
Block a user