1
0
Fork 0
nix-configuration/hosts/Shura/patches/lenovo-16ARHA7_speaker-fix.nix

38 lines
1 KiB
Nix
Raw Normal View History

2024-03-22 02:14:51 +00:00
# Patch sourced from https://github.com/christian-bendiksen/kernel-6.8.0-63.16ARHA7.fc40
2024-03-21 22:40:36 +00:00
{ pkgs, lib, kernel ? pkgs.linuxPackages_latest.kernel }:
2024-03-21 22:34:28 +00:00
pkgs.stdenv.mkDerivation {
2024-03-22 02:14:51 +00:00
pname = "lenovo-16ARHA7-speaker-fix-module";
2024-03-21 22:34:28 +00:00
inherit (kernel) src version postPatch nativeBuildInputs;
kernel_dev = kernel.dev;
kernelVersion = kernel.modDirVersion;
modulePath = "sound/pci/hda/";
buildPhase = ''
BUILT_KERNEL=$kernel_dev/lib/modules/$kernelVersion/build
cp $BUILT_KERNEL/Module.symvers .
cp $BUILT_KERNEL/.config .
cp $kernel_dev/vmlinux .
make "-j$NIX_BUILD_CORES" modules_prepare
make "-j$NIX_BUILD_CORES" M=$modulePath modules
'';
installPhase = ''
make \
INSTALL_MOD_PATH="$out" \
XZ="xz -T$NIX_BUILD_CORES" \
M="$modulePath" \
modules_install
'';
2024-03-22 02:14:51 +00:00
patches = [ ./lenovo_16ARHA7_sound_fix.patch ];
2024-03-21 22:34:28 +00:00
meta = {
2024-03-22 02:14:51 +00:00
description = "Patch to get the speakers working for Lenovo Legion Slim 7 Gen 7 AMD (16ARHA7)";
2024-03-21 22:34:28 +00:00
license = lib.licenses.gpl3;
};
}