mirror of
https://github.com/nix-community/disko.git
synced 2026-12-02 22:13:28 +01: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:
1 parent
0d510fe40b
commit
f5cc4b55e5
2 files changed
+12
-1
No files matched your search
@@ -10,7 +10,7 @@ let
|
|||||||
vmTools = pkgs.vmTools.override {
|
vmTools = pkgs.vmTools.override {
|
||||||
rootModules = [ "9p" "9pnet_virtio" "virtio_pci" "virtio_blk" ] ++ nixosConfig.config.disko.extraRootModules;
|
rootModules = [ "9p" "9pnet_virtio" "virtio_pci" "virtio_blk" ] ++ nixosConfig.config.disko.extraRootModules;
|
||||||
kernel = pkgs.aggregateModules
|
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);
|
++ lib.optional (lib.elem "zfs" nixosConfig.config.disko.extraRootModules) zfs);
|
||||||
};
|
};
|
||||||
cleanedConfig = diskoLib.testLib.prepareDiskoConfig nixosConfig.config diskoLib.testLib.devices;
|
cleanedConfig = diskoLib.testLib.prepareDiskoConfig nixosConfig.config diskoLib.testLib.devices;
|
||||||
|
|||||||
+11
@@ -10,6 +10,17 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.disko = {
|
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 {
|
extraRootModules = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
description = ''
|
description = ''
|
||||||
|
|||||||
Reference in new issue
Block a user