runInLinuxVM: Use QEMU command line that works on other architectures
... by moving the existing definition to qemu-flags.nix and reusing that.
This commit is contained in:
committed by
Tuomas Tynkkynen
parent
8c4f8c51a6
commit
71631a922b
@@ -15,12 +15,6 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
|
||||
let
|
||||
|
||||
qemu = config.system.build.qemu or pkgs.qemu_test;
|
||||
qemuKvm = {
|
||||
"i686-linux" = "${qemu}/bin/qemu-kvm";
|
||||
"x86_64-linux" = "${qemu}/bin/qemu-kvm -cpu kvm64";
|
||||
"armv7l-linux" = "${qemu}/bin/qemu-system-arm -enable-kvm -machine virt -cpu host";
|
||||
"aarch64-linux" = "${qemu}/bin/qemu-system-aarch64 -enable-kvm -machine virt,gic-version=host -cpu host";
|
||||
}.${pkgs.stdenv.system};
|
||||
|
||||
vmName =
|
||||
if config.networking.hostName == ""
|
||||
@@ -79,7 +73,7 @@ let
|
||||
'')}
|
||||
|
||||
# Start QEMU.
|
||||
exec ${qemuKvm} \
|
||||
exec ${qemuBinary qemu} \
|
||||
-name ${vmName} \
|
||||
-m ${toString config.virtualisation.memorySize} \
|
||||
-smp ${toString config.virtualisation.cores} \
|
||||
|
||||
Reference in New Issue
Block a user