From 5dbd4f32433b4f8511c702ee8bb66e8b4fff7b87 Mon Sep 17 00:00:00 2001 From: emilylange Date: Fri, 26 May 2023 19:43:58 +0200 Subject: [PATCH] nixos/qemu-vm: add `virtualisation.memorySize < 2048` assertion on 32bit --- nixos/modules/virtualisation/qemu-vm.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 5f6bf4b39e97..5dfc77cb428a 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -863,7 +863,13 @@ in The address must be in the default VLAN (10.0.2.0/24). ''; } - ])); + ])) ++ [ + { assertion = pkgs.stdenv.hostPlatform.is32bit && cfg.memorySize < 2047; + message = '' + virtualisation.memorySize is above 2047, but qemu is only able to allocate 2047MB RAM on 32bit max. + ''; + } + ]; warnings = optional (