mirror of
https://github.com/nix-community/disko.git
synced 2024-09-11 06:25:33 +03:00
Merge pull request #698 from MatthewCroughan/mc/make-builder-kernel-configurable
make-disk-image: make pkgs, qemu and kernelPackages configurable and overridable
This commit is contained in:
commit
f1e929d121
@ -1,6 +1,6 @@
|
||||
{ nixosConfig
|
||||
, diskoLib
|
||||
, pkgs ? nixosConfig.pkgs
|
||||
, pkgs ? nixosConfig.config.disko.imageBuilderPkgs
|
||||
, lib ? pkgs.lib
|
||||
, name ? "${nixosConfig.config.networking.hostName}-disko-images"
|
||||
, extraPostVM ? nixosConfig.config.disko.extraPostVM
|
||||
@ -9,8 +9,9 @@
|
||||
let
|
||||
vmTools = pkgs.vmTools.override {
|
||||
rootModules = [ "9p" "9pnet_virtio" "virtio_pci" "virtio_blk" ] ++ nixosConfig.config.disko.extraRootModules;
|
||||
customQemu = nixosConfig.config.disko.imageBuilderQemu;
|
||||
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;
|
||||
|
28
module.nix
28
module.nix
@ -10,6 +10,34 @@ let
|
||||
in
|
||||
{
|
||||
options.disko = {
|
||||
imageBuilderQemu = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = ''
|
||||
the qemu emulator string used when building disk images via make-disk-image.nix.
|
||||
Useful when using binfmt on your build host, and wanting to build disk
|
||||
images for a foreign architecture
|
||||
'';
|
||||
default = null;
|
||||
example = lib.literalExpression "''${pkgs.qemu_kvm}/bin/qemu-system-aarch64";
|
||||
};
|
||||
imageBuilderPkgs = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
description = ''
|
||||
the pkgs instance used when building disk images via make-disk-image.nix.
|
||||
Useful when the config's kernel won't boot in the image-builder.
|
||||
'';
|
||||
default = pkgs;
|
||||
example = lib.literalExpression "pkgs";
|
||||
};
|
||||
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