mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 12:29:02 +02:00
Merge pull request #218043 from addict3d/parameterise-guest-memsize-1
nixos/lib/make-disk-image: expose memSize parameter
This commit is contained in:
commit
0397ee1113
|
@ -101,6 +101,7 @@ in
|
||||||
diskSize = "auto";
|
diskSize = "auto";
|
||||||
additionalSpace = "0M"; # Defaults to 512M.
|
additionalSpace = "0M"; # Defaults to 512M.
|
||||||
copyChannel = false;
|
copyChannel = false;
|
||||||
|
memSize = 2048; # Qemu VM memory size in megabytes. Defaults to 1024M.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -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.
|
, # Shell code executed after the VM has finished.
|
||||||
postVM ? ""
|
postVM ? ""
|
||||||
|
|
||||||
|
, # Guest memory size
|
||||||
|
memSize ? 1024
|
||||||
|
|
||||||
, # Copy the contents of the Nix store to the root of the image and
|
, # Copy the contents of the Nix store to the root of the image and
|
||||||
# skip further setup. Incompatible with `contents`,
|
# skip further setup. Incompatible with `contents`,
|
||||||
# `installBootLoader` and `configFile`.
|
# `installBootLoader` and `configFile`.
|
||||||
|
@ -525,7 +528,7 @@ let format' = format; in let
|
||||||
"-drive if=pflash,format=raw,unit=1,file=$efiVars"
|
"-drive if=pflash,format=raw,unit=1,file=$efiVars"
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
memSize = 1024;
|
inherit memSize;
|
||||||
} ''
|
} ''
|
||||||
export PATH=${binPath}:$PATH
|
export PATH=${binPath}:$PATH
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,9 @@
|
||||||
, # Shell code executed after the VM has finished.
|
, # Shell code executed after the VM has finished.
|
||||||
postVM ? ""
|
postVM ? ""
|
||||||
|
|
||||||
|
, # Guest memory size
|
||||||
|
memSize ? 1024
|
||||||
|
|
||||||
, name ? "nixos-disk-image"
|
, name ? "nixos-disk-image"
|
||||||
|
|
||||||
, # Disk image format, one of qcow2, qcow2-compressed, vdi, vpc, raw.
|
, # Disk image format, one of qcow2, qcow2-compressed, vdi, vpc, raw.
|
||||||
|
@ -242,6 +245,7 @@ let
|
||||||
{
|
{
|
||||||
QEMU_OPTS = "-drive file=$bootDiskImage,if=virtio,cache=unsafe,werror=report"
|
QEMU_OPTS = "-drive file=$bootDiskImage,if=virtio,cache=unsafe,werror=report"
|
||||||
+ " -drive file=$rootDiskImage,if=virtio,cache=unsafe,werror=report";
|
+ " -drive file=$rootDiskImage,if=virtio,cache=unsafe,werror=report";
|
||||||
|
inherit memSize;
|
||||||
preVM = ''
|
preVM = ''
|
||||||
PATH=$PATH:${pkgs.qemu_kvm}/bin
|
PATH=$PATH:${pkgs.qemu_kvm}/bin
|
||||||
mkdir $out
|
mkdir $out
|
||||||
|
|
Loading…
Reference in a new issue