aboutsummaryrefslogtreecommitdiff
path: root/server.nix
diff options
context:
space:
mode:
Diffstat (limited to 'server.nix')
-rw-r--r--server.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/server.nix b/server.nix
index 78f9e29..f4aeb82 100644
--- a/server.nix
+++ b/server.nix
@@ -134,11 +134,17 @@ writeShellApplication {
runtimeInputs = [ qemu ];
text = ''
- rm -f ./reMder.qcow2
- qemu-img create -b ${diskImage} -F qcow2 -f qcow2 ./reMder.qcow2
+ # check if we're on an aarch64 system with support for aarch32 at EL1
+ if echo quit | qemu-system-aarch64 -machine virt -accel kvm -cpu host,aarch64=off \
+ -display none -nodefaults -S -monitor stdio >/dev/null 2>&1; then
+ qemu="qemu-system-aarch64"
+ accel_opts=(-accel kvm -cpu "host,aarch64=off")
+ else
+ qemu="qemu-system-arm"
+ accel_opts=()
+ fi
- qemu-system-arm \
- -machine virt \
+ exec "$qemu" -machine virt "''${accel_opts[@]}" \
-m 2048 \
-kernel ${kernel}/zImage \
-snapshot \