diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index c70774e16bc3..b402d2b3950d 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -11287,6 +11287,13 @@ github = "keenanweaver"; githubId = 37268985; }; + keksgesicht = { + name = "Jan Braun"; + email = "git@keksgesicht.de"; + github = "Keksgesicht"; + githubId = 32649612; + keys = [ { fingerprint = "65DF D21C 22A9 E4CD FD1A 0804 C3D7 16E7 29B3 C86A"; } ]; + }; keldu = { email = "mail@keldu.de"; github = "keldu"; diff --git a/nixos/modules/hardware/tuxedo-drivers.nix b/nixos/modules/hardware/tuxedo-drivers.nix new file mode 100644 index 000000000000..aa951782dbc0 --- /dev/null +++ b/nixos/modules/hardware/tuxedo-drivers.nix @@ -0,0 +1,35 @@ +{ config, lib, ... }: +let + cfg = config.hardware.tuxedo-drivers; + tuxedo-drivers = config.boot.kernelPackages.tuxedo-drivers; +in +{ + imports = [ + (lib.mkRenamedOptionModule + [ + "hardware" + "tuxedo-keyboard" + ] + [ + "hardware" + "tuxedo-drivers" + ] + ) + ]; + + options.hardware.tuxedo-drivers = { + enable = lib.mkEnableOption '' + The tuxedo-drivers driver enables access to the following on TUXEDO notebooks: + - Driver for Fn-keys + - SysFS control of brightness/color/mode for most TUXEDO keyboards + - Hardware I/O driver for TUXEDO Control Center + + For more inforation it is best to check at the source code description: + ''; + }; + + config = lib.mkIf cfg.enable { + boot.kernelModules = [ "tuxedo_keyboard" ]; + boot.extraModulePackages = [ tuxedo-drivers ]; + }; +} diff --git a/nixos/modules/hardware/tuxedo-keyboard.nix b/nixos/modules/hardware/tuxedo-keyboard.nix deleted file mode 100644 index 01ec486fb88f..000000000000 --- a/nixos/modules/hardware/tuxedo-keyboard.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.hardware.tuxedo-keyboard; - tuxedo-keyboard = config.boot.kernelPackages.tuxedo-keyboard; -in - { - options.hardware.tuxedo-keyboard = { - enable = lib.mkEnableOption '' - the tuxedo-keyboard driver. - - To configure the driver, pass the options to the {option}`boot.kernelParams` configuration. - There are several parameters you can change. It's best to check at the source code description which options are supported. - You can find all the supported parameters at: - - In order to use the `custom` lighting with the maximumg brightness and a color of `0xff0a0a` one would put pass {option}`boot.kernelParams` like this: - - ``` - boot.kernelParams = [ - "tuxedo_keyboard.mode=0" - "tuxedo_keyboard.brightness=255" - "tuxedo_keyboard.color_left=0xff0a0a" - ]; - ``` - ''; - }; - - config = lib.mkIf cfg.enable - { - boot.kernelModules = ["tuxedo_keyboard"]; - boot.extraModulePackages = [ tuxedo-keyboard ]; - }; - } diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7b753937e808..5fb66a03f9f0 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -98,7 +98,7 @@ ./hardware/sensor/iio.nix ./hardware/steam-hardware.nix ./hardware/system-76.nix - ./hardware/tuxedo-keyboard.nix + ./hardware/tuxedo-drivers.nix ./hardware/ubertooth.nix ./hardware/uinput.nix ./hardware/uni-sync.nix diff --git a/nixos/modules/services/hardware/tuxedo-rs.nix b/nixos/modules/services/hardware/tuxedo-rs.nix index cfdc1c64d118..4ba7825ae8a5 100644 --- a/nixos/modules/services/hardware/tuxedo-rs.nix +++ b/nixos/modules/services/hardware/tuxedo-rs.nix @@ -14,7 +14,7 @@ in config = lib.mkIf cfg.enable (lib.mkMerge [ { - hardware.tuxedo-keyboard.enable = true; + hardware.tuxedo-drivers.enable = true; systemd = { services.tailord = { diff --git a/pkgs/os-specific/linux/tuxedo-drivers/default.nix b/pkgs/os-specific/linux/tuxedo-drivers/default.nix new file mode 100644 index 000000000000..805d2c553473 --- /dev/null +++ b/pkgs/os-specific/linux/tuxedo-drivers/default.nix @@ -0,0 +1,55 @@ +{ + lib, + stdenv, + fetchFromGitLab, + kernel, + kmod, + pahole, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "tuxedo-drivers-${kernel.version}"; + version = "4.9.0"; + + src = fetchFromGitLab { + group = "tuxedocomputers"; + owner = "development/packages"; + repo = "tuxedo-drivers"; + rev = "v${finalAttrs.version}"; + hash = "sha256-b0ogwUA9k5NKyTyJUigt/EN1V8Q+8Tc6I+y6isBcet0="; + }; + + buildInputs = [ pahole ]; + nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies; + + # kernel makeFlags contain O=$$(buildRoot), that upstream passes through to make and causes build failure, so we filter it out here + makeFlags = + (lib.filter (flag: lib.head (lib.strings.splitString "=" flag) != "O") kernel.makeFlags) + ++ [ + "KERNELRELEASE=${kernel.modDirVersion}" + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "INSTALL_MOD_PATH=${placeholder "out"}" + ]; + + meta = { + broken = stdenv.hostPlatform.isAarch64 || (lib.versionOlder kernel.version "5.5"); + description = "Keyboard and hardware I/O driver for TUXEDO Computers laptops"; + homepage = "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers"; + license = lib.licenses.gpl3Plus; + longDescription = '' + Drivers for several platform devices for TUXEDO notebooks: + - Driver for Fn-keys + - SysFS control of brightness/color/mode for most TUXEDO keyboards + - Hardware I/O driver for TUXEDO Control Center + + Can be used with the "hardware.tuxedo-drivers" NixOS module. + ''; + maintainers = with lib.maintainers; [ + aprl + blanky0230 + keksgesicht + xaverdh + ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/os-specific/linux/tuxedo-keyboard/default.nix b/pkgs/os-specific/linux/tuxedo-keyboard/default.nix deleted file mode 100644 index 23285d5e26d2..000000000000 --- a/pkgs/os-specific/linux/tuxedo-keyboard/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ lib, stdenv, fetchFromGitHub, kernel, linuxHeaders, pahole }: - -stdenv.mkDerivation (finalAttrs: { - pname = "tuxedo-keyboard-${kernel.version}"; - version = "3.2.14"; - - src = fetchFromGitHub { - owner = "tuxedocomputers"; - repo = "tuxedo-keyboard"; - rev = "v${finalAttrs.version}"; - hash = "sha256-L3NsUUKA/snUcRWwlZidsBiTznhfulNldidEDDmNOkw="; - }; - - buildInputs = [ - pahole - linuxHeaders - ]; - - makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; - - installPhase = '' - runHook preInstall - - mkdir -p "$out/lib/modules/${kernel.modDirVersion}" - - for module in clevo_acpi.ko clevo_wmi.ko tuxedo_keyboard.ko tuxedo_io/tuxedo_io.ko uniwill_wmi.ko; do - mv src/$module $out/lib/modules/${kernel.modDirVersion} - done - - runHook postInstall - ''; - - meta = { - broken = stdenv.hostPlatform.isAarch64 || (lib.versionOlder kernel.version "5.5"); - description = "Keyboard and hardware I/O driver for TUXEDO Computers laptops"; - homepage = "https://github.com/tuxedocomputers/tuxedo-keyboard/"; - license = lib.licenses.gpl3Plus; - 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. - ''; - maintainers = [ lib.maintainers.blanky0230 ]; - platforms = lib.platforms.linux; - }; -}) diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index d9fade706894..663aa9191cc3 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -474,7 +474,7 @@ in { rust-out-of-tree-module = if lib.versionAtLeast kernel.version "6.7" then callPackage ../os-specific/linux/rust-out-of-tree-module { } else null; - tuxedo-keyboard = if lib.versionAtLeast kernel.version "4.14" then callPackage ../os-specific/linux/tuxedo-keyboard { } else null; + tuxedo-drivers = if lib.versionAtLeast kernel.version "4.14" then callPackage ../os-specific/linux/tuxedo-drivers { } else null; jool = callPackage ../os-specific/linux/jool { }; @@ -606,6 +606,7 @@ in { kvdo = throw "kvdo was removed, because it was added to mainline in kernel version 6.9"; # Added 2024-07-08 system76-power = lib.warn "kernelPackages.system76-power is now pkgs.system76-power" pkgs.system76-power; # Added 2024-10-16 system76-scheduler = lib.warn "kernelPackages.system76-scheduler is now pkgs.system76-scheduler" pkgs.system76-scheduler; # Added 2024-10-16 + tuxedo-keyboard = self.tuxedo-drivers; # Added 2024-09-28 }); hardenedPackagesFor = kernel: overrides: packagesFor (hardenedKernelFor kernel overrides);