about summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorNick Bathum <nickbathum@gmail.com>2023-02-24 10:36:31 -0500
committerNick Bathum <nickbathum@gmail.com>2023-02-26 12:08:58 -0500
commit59462da91769ff9d089a753a26ba77387349441d (patch)
tree1db60a51553431706f619060e3ae3ba397a669b7 /nixos/lib
parent32a93b58b2eab85e31cff79662c4e6056f18d9fd (diff)
downloadnixlib-59462da91769ff9d089a753a26ba77387349441d.tar
nixlib-59462da91769ff9d089a753a26ba77387349441d.tar.gz
nixlib-59462da91769ff9d089a753a26ba77387349441d.tar.bz2
nixlib-59462da91769ff9d089a753a26ba77387349441d.tar.lz
nixlib-59462da91769ff9d089a753a26ba77387349441d.tar.xz
nixlib-59462da91769ff9d089a753a26ba77387349441d.tar.zst
nixlib-59462da91769ff9d089a753a26ba77387349441d.zip
nixos/lib/make-disk-image: expose memSize parameter
Generating large disk images can fail from out-of-memory in vm-run.
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/make-disk-image.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix
index 365fc1f03a5b..d641d1289fe4 100644
--- a/nixos/lib/make-disk-image.nix
+++ b/nixos/lib/make-disk-image.nix
@@ -154,6 +154,9 @@ To solve this, you can run `fdisk -l $image` and generate `dd if=$image of=$imag
 , # Shell code executed after the VM has finished.
   postVM ? ""
 
+, # Guest memory size
+  memSize ? 1024
+
 , # Copy the contents of the Nix store to the root of the image and
   # skip further setup. Incompatible with `contents`,
   # `installBootLoader` and `configFile`.
@@ -525,7 +528,7 @@ let format' = format; in let
           "-drive if=pflash,format=raw,unit=1,file=$efiVars"
         ]
       );
-      memSize = 1024;
+      inherit memSize;
     } ''
       export PATH=${binPath}:$PATH