Merge pull request #146179 from Artturin/nixosgenerateconfig1

authored by

Artturi and committed by
GitHub
935c9a36 5bea0fab

+8
+8
nixos/modules/installer/tools/nixos-generate-config.pl
··· 91 } 92 93 94 95 # Determine CPU governor to use 96 if (-e "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors") { ··· 110 # Virtualization support? 111 push @kernelModules, "kvm-intel" if hasCPUFeature "vmx"; 112 push @kernelModules, "kvm-amd" if hasCPUFeature "svm"; 113 114 115 # Look at the PCI devices and add necessary modules. Note that most
··· 91 } 92 93 94 + sub cpuManufacturer { 95 + my $id = shift; 96 + return $cpuinfo =~ /^vendor_id\s*:.* $id$/m; 97 + } 98 + 99 100 # Determine CPU governor to use 101 if (-e "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors") { ··· 115 # Virtualization support? 116 push @kernelModules, "kvm-intel" if hasCPUFeature "vmx"; 117 push @kernelModules, "kvm-amd" if hasCPUFeature "svm"; 118 + 119 + push @attrs, "hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;" if cpuManufacturer "AuthenticAMD"; 120 + push @attrs, "hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;" if cpuManufacturer "GenuineIntel"; 121 122 123 # Look at the PCI devices and add necessary modules. Note that most