ucodenix
is a Nix flake providing AMD microcode updates for unsupported CPUs.
Note
Microcodes are fetched from this repository, which aggregates them from official sources provided and made public by various manufacturers.
- Fetches the microcode binary based on your processor's model ID.
- Generates the microcode container as used by the Linux kernel.
- Integrates the generated microcode into the NixOS configuration.
Add the flake as an input:
inputs.ucodenix.url = "github:e-tho/ucodenix";
Install cpuid
and run the following command to retrieve your processor's model ID:
cpuid -1 -l 1 -r | sed -n 's/.*eax=0x\([0-9a-f]*\).*/\U\1/p'
Enable the ucodenix NixOS module and set the model ID in your configuration:
{ inputs, ... }:
{
imports = [ inputs.ucodenix.nixosModules.default ];
services.ucodenix = {
enable = true;
cpuModelId = "00A20F12"; # Replace with your processor's model ID
};
}
Setting cpuModelId
to "auto"
enables automatic detection of the CPU model ID at build time. Note that this makes the build non-reproducible, so specifying cpuModelId
manually is recommended.
AMD only supplies microcodes to linux-firmware
for certain server-grade CPUs. For consumer CPUs, updates are distributed through BIOS releases by motherboard and laptop manufacturers, which can be inconsistent, delayed, or even discontinued over time. This flake ensures you have the latest microcodes directly on NixOS, without depending on BIOS updates.
The microcodes are obtained from official sources and are checked for integrity and size. The Linux kernel has built-in safeguards and will only load microcode that is compatible with your CPU, otherwise defaulting to the BIOS-provided version.
This software is provided "as is" without any guarantees.
GPLv3