summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2023-10-19 10:11:07 +0100
committerMichael Hoang <enzime@users.noreply.github.com>2023-10-24 13:35:37 +0200
commitab1f45f3d3b12a2e2809bea0a18e2b4b873e1810 (patch)
treef8434a121f5194a6bd65f72ac975d0117304a25b /nixos
parent12bdeb01ff9e2d3917e6a44037ed7df6e6c3df9d (diff)
downloadnixpkgs-ab1f45f3d3b12a2e2809bea0a18e2b4b873e1810.tar
nixpkgs-ab1f45f3d3b12a2e2809bea0a18e2b4b873e1810.tar.gz
nixpkgs-ab1f45f3d3b12a2e2809bea0a18e2b4b873e1810.tar.bz2
nixpkgs-ab1f45f3d3b12a2e2809bea0a18e2b4b873e1810.tar.lz
nixpkgs-ab1f45f3d3b12a2e2809bea0a18e2b4b873e1810.tar.xz
nixpkgs-ab1f45f3d3b12a2e2809bea0a18e2b4b873e1810.tar.zst
nixpkgs-ab1f45f3d3b12a2e2809bea0a18e2b4b873e1810.zip
linux-builder: support `x86_64-linux` on `aarch64`
Diffstat (limited to 'nixos')
-rw-r--r--nixos/lib/qemu-common.nix1
-rw-r--r--nixos/modules/virtualisation/qemu-vm.nix4
2 files changed, 3 insertions, 2 deletions
diff --git a/nixos/lib/qemu-common.nix b/nixos/lib/qemu-common.nix
index 4fff2e0a6f1..b946f62d93d 100644
--- a/nixos/lib/qemu-common.nix
+++ b/nixos/lib/qemu-common.nix
@@ -40,6 +40,7 @@ rec {
       otherHostGuestMatrix = {
         aarch64-darwin = {
           aarch64-linux = "${qemuPkg}/bin/qemu-system-aarch64 -machine virt,gic-version=2,accel=hvf:tcg -cpu max";
+          inherit (otherHostGuestMatrix.x86_64-darwin) x86_64-linux;
         };
         x86_64-darwin = {
           x86_64-linux = "${qemuPkg}/bin/qemu-system-x86_64 -machine type=q35,accel=hvf:tcg -cpu max";
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index e0004df6f6b..e335656a994 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -656,8 +656,8 @@ in
       package =
         mkOption {
           type = types.package;
-          default = hostPkgs.qemu_kvm;
-          defaultText = literalExpression "config.virtualisation.host.pkgs.qemu_kvm";
+          default = if hostPkgs.stdenv.hostPlatform.qemuArch == pkgs.stdenv.hostPlatform.qemuArch then hostPkgs.qemu_kvm else hostPkgs.qemu;
+          defaultText = literalExpression "if hostPkgs.stdenv.hostPlatform.qemuArch == pkgs.stdenv.hostPlatform.qemuArch then config.virtualisation.host.pkgs.qemu_kvm else config.virtualisation.host.pkgs.qemu";
           example = literalExpression "pkgs.qemu_test";
           description = lib.mdDoc "QEMU package to use.";
         };