summary refs log tree commit diff
path: root/nixos/lib/qemu-flags.nix
diff options
context:
space:
mode:
authorRyan Burns <rtburns@protonmail.com>2021-03-05 01:56:15 -0800
committerRyan Burns <rtburns@protonmail.com>2021-03-05 01:57:54 -0800
commit0ebf63de087aba866c96b0e3b8eeb382f227b32c (patch)
treeb1f3b182040a85d01dd713cdcdf7dfe610b892c7 /nixos/lib/qemu-flags.nix
parent96e9a7c30b79ff633eb2c48ab42428e63997429f (diff)
downloadnixpkgs-0ebf63de087aba866c96b0e3b8eeb382f227b32c.tar
nixpkgs-0ebf63de087aba866c96b0e3b8eeb382f227b32c.tar.gz
nixpkgs-0ebf63de087aba866c96b0e3b8eeb382f227b32c.tar.bz2
nixpkgs-0ebf63de087aba866c96b0e3b8eeb382f227b32c.tar.lz
nixpkgs-0ebf63de087aba866c96b0e3b8eeb382f227b32c.tar.xz
nixpkgs-0ebf63de087aba866c96b0e3b8eeb382f227b32c.tar.zst
nixpkgs-0ebf63de087aba866c96b0e3b8eeb382f227b32c.zip
nixos/qemu-flags: add ppc64
* PPC uses ttyAMA0 as its serial device, similar to ARM.
* PowerNV is a typical platform for testing and distro development
Diffstat (limited to 'nixos/lib/qemu-flags.nix')
-rw-r--r--nixos/lib/qemu-flags.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/lib/qemu-flags.nix b/nixos/lib/qemu-flags.nix
index 0f066245893..f786745ba32 100644
--- a/nixos/lib/qemu-flags.nix
+++ b/nixos/lib/qemu-flags.nix
@@ -18,13 +18,15 @@ rec {
     ];
 
   qemuSerialDevice = if pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64 then "ttyS0"
-        else if pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64 then "ttyAMA0"
+        else if (with pkgs.stdenv.hostPlatform; isAarch32 || isAarch64 || isPower) then "ttyAMA0"
         else throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'";
 
   qemuBinary = qemuPkg: {
     x86_64-linux = "${qemuPkg}/bin/qemu-kvm -cpu max";
     armv7l-linux = "${qemuPkg}/bin/qemu-system-arm -enable-kvm -machine virt -cpu host";
     aarch64-linux = "${qemuPkg}/bin/qemu-system-aarch64 -enable-kvm -machine virt,gic-version=host -cpu host";
+    powerpc64le-linux = "${qemuPkg}/bin/qemu-system-ppc64 -machine powernv";
+    powerpc64-linux = "${qemuPkg}/bin/qemu-system-ppc64 -machine powernv";
     x86_64-darwin = "${qemuPkg}/bin/qemu-kvm -cpu max";
   }.${pkgs.stdenv.hostPlatform.system} or "${qemuPkg}/bin/qemu-kvm";
 }