hostconfig/minus: Add the CEC environnement

This commit is contained in:
Quentin Boyer 2024-07-27 21:56:35 +02:00
parent f1b7eaaa4a
commit 00330b4102
3 changed files with 89 additions and 6 deletions

View file

@ -26,6 +26,7 @@
flex-launcher = pkgs.callPackage ./flex-launcher.nix { };
mesonlsp = pkgs.callPackage ./mesonlsp { };
push-to-talk = pkgs.callPackage ./push-to-talk.nix { };
pulse8-cec = pkgs.callPackage ./pulse8-cec.nix { };
};
};
}

48
pkgs/pulse8-cec.nix Normal file
View file

@ -0,0 +1,48 @@
{
stdenv,
lib,
linuxPackages,
kernel ? linuxPackages.kernel,
}:
stdenv.mkDerivation {
pname = "pulse8-cec-module";
inherit (kernel)
src
version
postPatch
nativeBuildInputs
;
kernel_dev = kernel.dev;
kernelVersion = kernel.modDirVersion;
modulePath = "drivers/media/cec/usb/pulse8";
buildPhase = ''
BUILT_KERNEL=$kernel_dev/lib/modules/$kernelVersion/build
cp $BUILT_KERNEL/Module.symvers .
cat $BUILT_KERNEL/.config >.config
cp $kernel_dev/vmlinux .
./scripts/config --enable CONFIG_MEDIA_CEC_SUPPORT
./scripts/config --module CONFIG_USB_PULSE8_CEC
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
'';
meta = {
description = "Pulse 8 CEC kernel module";
license = lib.licenses.gpl2;
};
}