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>";
}

View File

@ -38,7 +38,6 @@ let
name = "nixos-generate-config";
src = ./nixos-generate-config.pl;
perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl";
inherit (pkgs) dmidecode;
};
nixos-option = makeProg {