diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-03-30 17:26:43 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-03-30 17:27:18 +0200 |
commit | 075168ca817420f6cb845353791945e251aff122 (patch) | |
tree | 2d774eb2e8bee79dd98d7ad2987d6ad76d873a80 /nixos/modules/installer | |
parent | aaf01268ffde61bd970df886fb2d11f8dc96175d (diff) | |
download | nixlib-075168ca817420f6cb845353791945e251aff122.tar nixlib-075168ca817420f6cb845353791945e251aff122.tar.gz nixlib-075168ca817420f6cb845353791945e251aff122.tar.bz2 nixlib-075168ca817420f6cb845353791945e251aff122.tar.lz nixlib-075168ca817420f6cb845353791945e251aff122.tar.xz nixlib-075168ca817420f6cb845353791945e251aff122.tar.zst nixlib-075168ca817420f6cb845353791945e251aff122.zip |
nixos-hardware-scan: Detect QEMU
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index bf7cdcd37119..d42c4c1f1dc2 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -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"); |