mirror of
https://github.com/nix-community/disko.git
synced 2026-12-05 07:23:28 +01:00
make-disk-image: inherit kernel from nixosConfiguration
This commit is contained in:
1 parent
d5cf2e3d61
commit
bb75ad0b1d
2 files changed
+14
-2
No files matched your search
@@ -7,6 +7,11 @@
|
|||||||
, checked ? false
|
, checked ? false
|
||||||
}:
|
}:
|
||||||
let
|
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 ]);
|
||||||
|
};
|
||||||
cleanedConfig = diskoLib.testLib.prepareDiskoConfig nixosConfig.config diskoLib.testLib.devices;
|
cleanedConfig = diskoLib.testLib.prepareDiskoConfig nixosConfig.config diskoLib.testLib.devices;
|
||||||
systemToInstall = nixosConfig.extendModules {
|
systemToInstall = nixosConfig.extendModules {
|
||||||
modules = [{
|
modules = [{
|
||||||
@@ -61,7 +66,7 @@ let
|
|||||||
QEMU_OPTS = lib.concatMapStringsSep " " (disk: "-drive file=${disk.name}.raw,if=virtio,cache=unsafe,werror=report") (lib.attrValues nixosConfig.config.disko.devices.disk);
|
QEMU_OPTS = lib.concatMapStringsSep " " (disk: "-drive file=${disk.name}.raw,if=virtio,cache=unsafe,werror=report") (lib.attrValues nixosConfig.config.disko.devices.disk);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
pure = pkgs.vmTools.runInLinuxVM (pkgs.runCommand name
|
pure = vmTools.runInLinuxVM (pkgs.runCommand name
|
||||||
{
|
{
|
||||||
buildInputs = dependencies;
|
buildInputs = dependencies;
|
||||||
inherit preVM postVM QEMU_OPTS;
|
inherit preVM postVM QEMU_OPTS;
|
||||||
@@ -160,7 +165,7 @@ in
|
|||||||
QEMU_OPTS+=" -m $build_memory"
|
QEMU_OPTS+=" -m $build_memory"
|
||||||
export QEMU_OPTS
|
export QEMU_OPTS
|
||||||
|
|
||||||
${pkgs.bash}/bin/sh -e ${pkgs.vmTools.vmRunCommand pkgs.vmTools.qemuCommandLinux}
|
${pkgs.bash}/bin/sh -e ${vmTools.vmRunCommand vmTools.qemuCommandLinux}
|
||||||
cd /
|
cd /
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,13 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.disko = {
|
options.disko = {
|
||||||
|
extraRootModules = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str ;
|
||||||
|
description = ''
|
||||||
|
extra modules to pass to the vmTools.runCommand invocation in the make-disk-image.nix builder
|
||||||
|
'';
|
||||||
|
default = [];
|
||||||
|
};
|
||||||
memSize = lib.mkOption {
|
memSize = lib.mkOption {
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
description = ''
|
description = ''
|
||||||
|
|||||||
Reference in new issue
Block a user