2023-03-23 03:48:13 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, linuxHeaders, pahole }:
|
2019-11-15 16:28:37 +01:00
|
|
|
|
2023-07-15 07:52:23 +02:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-11-15 16:28:37 +01:00
|
|
|
pname = "tuxedo-keyboard-${kernel.version}";
|
2023-07-12 13:57:15 +02:00
|
|
|
version = "3.2.7";
|
2019-11-15 16:28:37 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tuxedocomputers";
|
|
|
|
repo = "tuxedo-keyboard";
|
2023-07-15 07:52:23 +02:00
|
|
|
rev = "v${finalAttrs.version}";
|
2023-07-12 13:57:15 +02:00
|
|
|
hash = "sha256-Q0wnejeLGLSDS0GPxQuYUKCAdzbYA66KT0DuWsEKIRs=";
|
2019-11-15 16:28:37 +01:00
|
|
|
};
|
|
|
|
|
2023-03-23 03:48:13 +01:00
|
|
|
buildInputs = [
|
|
|
|
pahole
|
|
|
|
linuxHeaders
|
|
|
|
];
|
2021-04-30 14:52:14 +02:00
|
|
|
|
2019-11-15 16:28:37 +01:00
|
|
|
makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-07-15 07:52:23 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2019-11-15 16:28:37 +01:00
|
|
|
mkdir -p "$out/lib/modules/${kernel.modDirVersion}"
|
2021-08-06 20:27:29 +02:00
|
|
|
|
2022-12-09 18:22:03 +01:00
|
|
|
for module in clevo_acpi.ko clevo_wmi.ko tuxedo_keyboard.ko tuxedo_io/tuxedo_io.ko uniwill_wmi.ko; do
|
2021-08-06 20:27:29 +02:00
|
|
|
mv src/$module $out/lib/modules/${kernel.modDirVersion}
|
|
|
|
done
|
2023-07-15 07:52:23 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
2019-11-15 16:28:37 +01:00
|
|
|
'';
|
|
|
|
|
2023-07-15 07:52:23 +02:00
|
|
|
meta = {
|
|
|
|
broken = stdenv.isAarch64 || (lib.versionOlder kernel.version "5.5");
|
2022-01-11 21:06:23 +01:00
|
|
|
description = "Keyboard and hardware I/O driver for TUXEDO Computers laptops";
|
2023-07-15 07:52:23 +02:00
|
|
|
homepage = "https://github.com/tuxedocomputers/tuxedo-keyboard/";
|
|
|
|
license = lib.licenses.gpl3Plus;
|
2022-01-11 21:06:23 +01:00
|
|
|
longDescription = ''
|
|
|
|
This driver provides support for Fn keys, brightness/color/mode for most TUXEDO
|
|
|
|
keyboards (except white backlight-only models).
|
|
|
|
|
|
|
|
Can be used with the "hardware.tuxedo-keyboard" NixOS module.
|
|
|
|
'';
|
2023-07-15 07:52:23 +02:00
|
|
|
maintainers = [ lib.maintainers.blanky0230 ];
|
|
|
|
platforms = lib.platforms.linux;
|
2019-11-15 16:28:37 +01:00
|
|
|
};
|
2023-07-15 07:52:23 +02:00
|
|
|
})
|