2023-03-24 00:07:29 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, linuxHeaders, pahole }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "tuxedo-keyboard-${kernel.version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "3.2.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tuxedocomputers";
|
|
|
|
repo = "tuxedo-keyboard";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-Q0wnejeLGLSDS0GPxQuYUKCAdzbYA66KT0DuWsEKIRs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
buildInputs = [
|
|
|
|
pahole
|
|
|
|
linuxHeaders
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p "$out/lib/modules/${kernel.modDirVersion}"
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
for module in clevo_acpi.ko clevo_wmi.ko tuxedo_keyboard.ko tuxedo_io/tuxedo_io.ko uniwill_wmi.ko; do
|
2021-09-18 10:52:07 +00:00
|
|
|
mv src/$module $out/lib/modules/${kernel.modDirVersion}
|
|
|
|
done
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
meta = {
|
|
|
|
broken = stdenv.isAarch64 || (lib.versionOlder kernel.version "5.5");
|
2022-01-13 20:06:32 +00:00
|
|
|
description = "Keyboard and hardware I/O driver for TUXEDO Computers laptops";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/tuxedocomputers/tuxedo-keyboard/";
|
|
|
|
license = lib.licenses.gpl3Plus;
|
2022-01-13 20:06:32 +00: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 17:15:38 +00:00
|
|
|
maintainers = [ lib.maintainers.blanky0230 ];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|