make-disk-image: make memSize configurable per disk

Sometimes the VM builder can run out of memory and fail to allocate memory when installing the system toplevel
This commit is contained in:
matthewcroughan 2023-12-12 22:47:37 +00:00 committed by mergify[bot]
parent 169e99dc3d
commit bd8fbc3f27
2 changed files with 8 additions and 1 deletions

View File

@ -65,7 +65,7 @@ in
{
buildInputs = dependencies;
inherit preVM postVM QEMU_OPTS;
memSize = 1024;
memSize = nixosConfig.config.disko.memSize;
}
(partitioner + installer));
impure = diskoLib.writeCheckedBash { inherit checked pkgs; } name ''

View File

@ -10,6 +10,13 @@ let
in
{
options.disko = {
memSize = lib.mkOption {
type = lib.types.int;
description = ''
size of the memory passed to runInLinuxVM, in megabytes
'';
default = 1024;
};
devices = lib.mkOption {
type = diskoLib.toplevel;
default = { };