Skip to content

Commit

Permalink
tuxedo-keyboard: rename config option and package to tuxedo-driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Keksgesicht committed Sep 3, 2024
1 parent 815ea20 commit 19cd864
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 46 deletions.
28 changes: 28 additions & 0 deletions nixos/modules/hardware/tuxedo-driver.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ config, lib, ... }:
let
cfg = config.hardware.tuxedo-driver;
tuxedo-driver = config.boot.kernelPackages.tuxedo-driver;
in {
imports = [
(lib.mkRenamedOptionModule [ "hardware" "tuxedo-keyboard" ] [
"hardware"
"tuxedo-driver"
])
];

options.hardware.tuxedo-driver = {
enable = lib.mkEnableOption ''
The tuxedo-driver 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: <https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers>
'';
};

config = lib.mkIf cfg.enable {
boot.kernelModules = [ "tuxedo_keyboard" ];
boot.extraModulePackages = [ tuxedo-driver ];
};
}
32 changes: 0 additions & 32 deletions nixos/modules/hardware/tuxedo-keyboard.nix

This file was deleted.

2 changes: 1 addition & 1 deletion nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
./hardware/sensor/iio.nix
./hardware/steam-hardware.nix
./hardware/system-76.nix
./hardware/tuxedo-keyboard.nix
./hardware/tuxedo-driver.nix
./hardware/ubertooth.nix
./hardware/uinput.nix
./hardware/uni-sync.nix
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/hardware/tuxedo-rs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ in

config = lib.mkIf cfg.enable (lib.mkMerge [
{
hardware.tuxedo-keyboard.enable = true;
hardware.tuxedo-driver.enable = true;

systemd = {
services.tailord = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, stdenv, fetchFromGitLab, kernel, linuxHeaders, pahole }:

stdenv.mkDerivation (finalAttrs: {
pname = "tuxedo-keyboard-${kernel.version}";
pname = "tuxedo-driver-${kernel.version}";
version = "4.6.2";

src = fetchFromGitLab {
Expand All @@ -12,12 +12,10 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-HS/KGhgFW0vO2SSFYSdseQBhAZC70eAx9JvRgR6e6qs=";
};

buildInputs = [
pahole
linuxHeaders
];
buildInputs = [ pahole linuxHeaders ];

makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];
makeFlags =
[ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];

installPhase = ''
runHook preInstall
Expand All @@ -32,14 +30,18 @@ stdenv.mkDerivation (finalAttrs: {

meta = {
broken = stdenv.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";
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 = ''
This driver provides support for Fn keys, brightness/color/mode for most TUXEDO
keyboards (except white backlight-only models).
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-keyboard" NixOS module.
Can be used with the "hardware.tuxedo-driver" NixOS module.
'';
maintainers = [ lib.maintainers.blanky0230 ];
platforms = lib.platforms.linux;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/linux-kernels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,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-driver = if lib.versionAtLeast kernel.version "4.14" then callPackage ../os-specific/linux/tuxedo-driver { } else null;

jool = callPackage ../os-specific/linux/jool { };

Expand Down

0 comments on commit 19cd864

Please sign in to comment.