0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 14:10:33 +03:00

nixos-generate-config: Use systemd-detect-virt instead of dmidecode

Dmidecode fails in our EFI test with the error "SMBIOS entry point
missing". But we don't need dmidecode because we have already have
systemd-detect-virt.
This commit is contained in:
Eelco Dolstra 2014-04-30 11:17:30 +02:00
parent 956f464fff
commit 8c75ae3838
2 changed files with 4 additions and 4 deletions

View file

@ -218,18 +218,19 @@ foreach my $path (glob "/sys/class/block/*") {
}
my $dmi = `@dmidecode@/sbin/dmidecode`;
my $virt = `systemd-detect-virt`;
chomp $virt;
# Check if we're a VirtualBox guest. If so, enable the guest
# additions.
if ($dmi =~ /Manufacturer: innotek/) {
if ($virt eq "oracle") {
push @attrs, "services.virtualbox.enable = true;"
}
# Likewise for QEMU.
if ($dmi =~ /Manufacturer: Bochs/) {
if ($virt eq "qemu" || $virt eq "kvm" || $virt eq "bochs") {
push @imports, "<nixpkgs/nixos/modules/profiles/qemu-guest.nix>";
}