diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2018-02-01 09:34:41 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2018-02-01 09:36:23 +0100 |
commit | 2fb4606f38deefa76da5d853645739f2faa315de (patch) | |
tree | de1003a2a8487fe792903ac3e295292d15608b3e /nixos/modules/virtualisation/qemu-vm.nix | |
parent | f0048025807b7f451a295e7b009c58e0c2282d70 (diff) | |
parent | be4c6311f3bc808cacff94e5e11240a7c37cbf9c (diff) | |
download | nixlib-2fb4606f38deefa76da5d853645739f2faa315de.tar nixlib-2fb4606f38deefa76da5d853645739f2faa315de.tar.gz nixlib-2fb4606f38deefa76da5d853645739f2faa315de.tar.bz2 nixlib-2fb4606f38deefa76da5d853645739f2faa315de.tar.lz nixlib-2fb4606f38deefa76da5d853645739f2faa315de.tar.xz nixlib-2fb4606f38deefa76da5d853645739f2faa315de.tar.zst nixlib-2fb4606f38deefa76da5d853645739f2faa315de.zip |
Merge branch 'master' into staging
Haskell rebuild. Hydra: ?compare=1430378
Diffstat (limited to 'nixos/modules/virtualisation/qemu-vm.nix')
-rw-r--r-- | nixos/modules/virtualisation/qemu-vm.nix | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 26f7945a4eda..13d0eb7de5c2 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -10,21 +10,11 @@ { config, lib, pkgs, ... }: with lib; +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}; - - # FIXME: figure out a common place for this instead of copy pasting - serialDevice = if pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64 then "ttyS0" - else if pkgs.stdenv.isArm || pkgs.stdenv.isAarch64 then "ttyAMA0" - else throw "Unknown QEMU serial device for system '${pkgs.stdenv.system}'"; vmName = if config.networking.hostName == "" @@ -34,7 +24,7 @@ let cfg = config.virtualisation; qemuGraphics = if cfg.graphics then "" else "-nographic"; - kernelConsole = if cfg.graphics then "" else "console=${serialDevice}"; + kernelConsole = if cfg.graphics then "" else "console=${qemuSerialDevice}"; ttys = [ "tty1" "tty2" "tty3" "tty4" "tty5" "tty6" ]; # Shell script to start the VM. @@ -83,7 +73,7 @@ let '')} # Start QEMU. - exec ${qemuKvm} \ + exec ${qemuBinary qemu} \ -name ${vmName} \ -m ${toString config.virtualisation.memorySize} \ -smp ${toString config.virtualisation.cores} \ |