mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +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:
parent
956f464fff
commit
8c75ae3838
@ -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>";
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user