Skip to content

Commit

Permalink
make-disk-image: make memSize configurable per disk
Browse files Browse the repository at this point in the history
Sometimes the VM builder can run out of memory and fail to allocate memory when installing the system toplevel
  • Loading branch information
MatthewCroughan authored and mergify[bot] committed Dec 13, 2023
1 parent 169e99d commit bd8fbc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/make-disk-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
Expand Down
7 changes: 7 additions & 0 deletions module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { };
Expand Down

0 comments on commit bd8fbc3

Please sign in to comment.