···91}
9293000009495# Determine CPU governor to use
96if (-e "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors") {
···110# Virtualization support?
111push @kernelModules, "kvm-intel" if hasCPUFeature "vmx";
112push @kernelModules, "kvm-amd" if hasCPUFeature "svm";
000113114115# Look at the PCI devices and add necessary modules. Note that most
···91}
929394+sub cpuManufacturer {
95+ my $id = shift;
96+ return $cpuinfo =~ /^vendor_id\s*:.* $id$/m;
97+}
98+99100# Determine CPU governor to use
101if (-e "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors") {
···115# Virtualization support?
116push @kernelModules, "kvm-intel" if hasCPUFeature "vmx";
117push @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";
121122123# Look at the PCI devices and add necessary modules. Note that most