Merge pull request #263658 from siriobalmelli-foss/sb/zfs-image

openstack-image-zfs and make-single-disk-zfs-image: optionally specify qemu instance memory
This commit is contained in:
Ryan Lahfa 2024-01-12 20:25:26 +01:00 committed by GitHub
commit f520eb3f0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -21,6 +21,9 @@
, # size of the FAT partition, in megabytes.
bootSize ? 1024
, # memory allocated for virtualized build instance
memSize ? 1024
, # The size of the root partition, in megabytes.
rootSize ? 2048
@ -230,7 +233,7 @@ let
).runInLinuxVM (
pkgs.runCommand name
{
memSize = 1024;
inherit memSize;
QEMU_OPTS = "-drive file=$rootDiskImage,if=virtio,cache=unsafe,werror=report";
preVM = ''
PATH=$PATH:${pkgs.qemu_kvm}/bin

View file

@ -20,6 +20,12 @@ in
default = "nixos-openstack-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
};
ramMB = mkOption {
type = types.int;
default = 1024;
description = lib.mdDoc "RAM allocation for build VM";
};
sizeMB = mkOption {
type = types.int;
default = 8192;
@ -64,7 +70,7 @@ in
includeChannel = copyChannel;
bootSize = 1000;
memSize = cfg.ramMB;
rootSize = cfg.sizeMB;
rootPoolProperties = {
ashift = 12;