about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authoremilylange <git@emilylange.de>2023-05-26 19:43:58 +0200
committeremilylange <git@emilylange.de>2023-05-26 19:43:58 +0200
commit5dbd4f32433b4f8511c702ee8bb66e8b4fff7b87 (patch)
tree8e6bac6c2d95a60e537d87f7d336912011fb4e8e /nixos
parentf91ee3065de91a3531329a674a45ddcb3467a650 (diff)
nixos/qemu-vm: add `virtualisation.memorySize < 2048` assertion on 32bit
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/virtualisation/qemu-vm.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 5f6bf4b39e974..5dfc77cb428aa 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 (