mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
nixos: pass stdenv into qemu-common
We also don't export it from `vmTools` anymore.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# QEMU-related utilities shared between various Nix expressions.
|
||||
{ lib, pkgs }:
|
||||
{ lib, stdenv }:
|
||||
|
||||
let
|
||||
zeroPad =
|
||||
@@ -17,19 +17,19 @@ rec {
|
||||
];
|
||||
|
||||
qemuSerialDevice =
|
||||
if with pkgs.stdenv.hostPlatform; isx86 || isLoongArch64 || isMips64 || isRiscV then
|
||||
if with stdenv.hostPlatform; isx86 || isLoongArch64 || isMips64 || isRiscV then
|
||||
"ttyS0"
|
||||
else if (with pkgs.stdenv.hostPlatform; isAarch || isPower) then
|
||||
else if (with stdenv.hostPlatform; isAarch || isPower) then
|
||||
"ttyAMA0"
|
||||
else
|
||||
throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'";
|
||||
throw "Unknown QEMU serial device for system '${stdenv.hostPlatform.system}'";
|
||||
|
||||
qemuBinary =
|
||||
qemuPkg:
|
||||
let
|
||||
hostStdenv = qemuPkg.stdenv;
|
||||
hostSystem = hostStdenv.system;
|
||||
guestSystem = pkgs.stdenv.hostPlatform.system;
|
||||
guestSystem = stdenv.hostPlatform.system;
|
||||
|
||||
linuxHostGuestMatrix = {
|
||||
x86_64-linux = "${qemuPkg}/bin/qemu-system-x86_64 -machine accel=kvm:tcg -cpu max";
|
||||
|
||||
@@ -30,7 +30,7 @@ let
|
||||
...
|
||||
}:
|
||||
let
|
||||
qemu-common = import ../qemu-common.nix { inherit lib pkgs; };
|
||||
qemu-common = import ../qemu-common.nix { inherit (pkgs) lib stdenv; };
|
||||
|
||||
# Convert legacy VLANs to named interfaces and merge with explicit interfaces.
|
||||
vlansNumbered = forEach (zipLists config.virtualisation.vlans (range 1 255)) (v: {
|
||||
|
||||
@@ -14,7 +14,7 @@ with lib;
|
||||
let
|
||||
cfg = config.testing;
|
||||
|
||||
qemu-common = import ../../lib/qemu-common.nix { inherit lib pkgs; };
|
||||
qemu-common = import ../../lib/qemu-common.nix { inherit (pkgs) lib stdenv; };
|
||||
|
||||
backdoorService = {
|
||||
requires = [
|
||||
|
||||
@@ -16,7 +16,7 @@ with lib;
|
||||
|
||||
let
|
||||
|
||||
qemu-common = import ../../lib/qemu-common.nix { inherit lib pkgs; };
|
||||
qemu-common = import ../../lib/qemu-common.nix { inherit (pkgs) lib stdenv; };
|
||||
|
||||
cfg = config.virtualisation;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ with import ../lib/testing-python.nix { inherit system pkgs; };
|
||||
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
qemu-common = import ../lib/qemu-common.nix { inherit lib pkgs; };
|
||||
qemu-common = import ../lib/qemu-common.nix { inherit (pkgs) lib stdenv; };
|
||||
|
||||
mkStartCommand =
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
qemu-common = import ../../lib/qemu-common.nix { inherit lib pkgs; };
|
||||
qemu-common = import ../../lib/qemu-common.nix { inherit (pkgs) lib stdenv; };
|
||||
vlanIfs = lib.range 1 (lib.length config.virtualisation.vlans);
|
||||
in
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
writeText,
|
||||
xz,
|
||||
zstd,
|
||||
pkgs,
|
||||
|
||||
# ----------------------------
|
||||
# The following arguments form the "interface" of `pkgs.vmTools`.
|
||||
@@ -47,7 +46,7 @@
|
||||
}:
|
||||
|
||||
let
|
||||
qemu-common = import ../../../nixos/lib/qemu-common.nix { inherit lib pkgs; };
|
||||
qemu-common = import ../../../nixos/lib/qemu-common.nix { inherit lib stdenv; };
|
||||
|
||||
qemu = buildPackages.qemu_kvm;
|
||||
|
||||
@@ -1323,8 +1322,6 @@ in
|
||||
makeImageTestScript
|
||||
modulesClosure
|
||||
qemu
|
||||
qemu-common
|
||||
qemuCommandLinux
|
||||
rpmClosureGenerator
|
||||
rpmDistros
|
||||
runInLinuxImage
|
||||
|
||||
Reference in New Issue
Block a user