Files
nixpkgs/pkgs/by-name/mi/microcode-amd/package.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

40 lines
987 B
Nix

{
lib,
stdenv,
linux-firmware,
libarchive,
}:
stdenv.mkDerivation {
pname = "amd-ucode";
version = linux-firmware.version;
src = linux-firmware;
sourceRoot = ".";
nativeBuildInputs = [ libarchive ];
buildPhase = ''
mkdir -p kernel/x86/microcode
find ${linux-firmware}/lib/firmware/amd-ucode -name \*.bin -print0 | sort -z |\
xargs -0 -I{} sh -c 'cat {} >> kernel/x86/microcode/AuthenticAMD.bin'
'';
installPhase = ''
mkdir -p $out
touch -d @$SOURCE_DATE_EPOCH kernel/x86/microcode/AuthenticAMD.bin
echo kernel/x86/microcode/AuthenticAMD.bin | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @- > $out/amd-ucode.img
'';
meta = {
description = "AMD Processor microcode patch";
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
license = lib.licenses.unfreeRedistributableFirmware;
platforms = [
"i686-linux"
"x86_64-linux"
];
};
}