1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 06:01:15 +00:00

nixos-hardware-scan: Detect QEMU

This commit is contained in:
Eelco Dolstra 2014-03-30 17:26:43 +02:00
parent aaf01268ff
commit 075168ca81
2 changed files with 9 additions and 2 deletions

View file

@ -216,14 +216,22 @@ foreach my $path (glob "/sys/class/block/*") {
}
my $dmi = `@dmidecode@/sbin/dmidecode`;
# Check if we're a VirtualBox guest. If so, enable the guest
# additions.
my $dmi = `@dmidecode@/sbin/dmidecode`;
if ($dmi =~ /Manufacturer: innotek/) {
push @attrs, "services.virtualbox.enable = true;"
}
# Likewise for QEMU.
if ($dmi =~ /Manufacturer: Bochs/) {
push @imports, "<nixpkgs/nixos/modules/profiles/qemu-guest.nix>";
}
# Generate the swapDevices option from the currently activated swap
# devices.
my @swaps = read_file("/proc/swaps");

View file

@ -39,7 +39,6 @@ let
{ imports =
[ ./hardware-configuration.nix
<nixpkgs/nixos/modules/profiles/qemu-guest.nix>
<nixpkgs/nixos/modules/testing/test-instrumentation.nix>
];