mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00: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
2 changed files with 12 additions and 1 deletions
|
@ -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 a new issue