Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tuxedo-keyboard: fix compilation for kernel 6.10 and 6.11 #336633

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions nixos/modules/hardware/tuxedo-drivers.nix
Original file line number Diff line number Diff line change
@@ -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: <https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers>
'';
};

config = lib.mkIf cfg.enable {
boot.kernelModules = [ "tuxedo_keyboard" ];
boot.extraModulePackages = [ tuxedo-drivers ];
};
}
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 @@ -97,7 +97,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
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-drivers.enable = true;

systemd = {
services.tailord = {
Expand Down
56 changes: 56 additions & 0 deletions pkgs/os-specific/linux/tuxedo-drivers/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
lib,
stdenv,
fetchFromGitLab,
kernel,
linuxHeaders,
pahole,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "tuxedo-drivers-${kernel.version}";
version = "4.7.0";

src = fetchFromGitLab {
group = "tuxedocomputers";
owner = "development/packages";
repo = "tuxedo-drivers";
rev = "v${finalAttrs.version}";
hash = "sha256-wZUQHIkbxt9ckTFs8VTrA5I+ebBeaOm+Fb0+GqX5y0c=";
};

buildInputs = [
pahole
linuxHeaders
];

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

installPhase = ''
runHook preInstall

mkdir -p "$out/lib/modules/${kernel.modDirVersion}"

find src/ -type f -name '*.ko' \
-exec mv {} $out/lib/modules/${kernel.modDirVersion} \;

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://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 = [ lib.maintainers.blanky0230 ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Keksgesicht @CutestNekoAqua If you like, join yourselves in as maintainers. Certainly better to have a bus-factor > 1 for this package I suppose.
(I'll soon have a suitable device again too).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Keksgesicht As per #343483 ->

maintainers = [ lib.maintainers.aprl ];

Also getting @xaverdh into the loop. So they know we're trying to tighten up all the various loose ends.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, whether I should add other people. But as they clearly want to develop this further, I could add them in the commit too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to add me!

platforms = lib.platforms.linux;
};
})
47 changes: 0 additions & 47 deletions pkgs/os-specific/linux/tuxedo-keyboard/default.nix

This file was deleted.

3 changes: 2 additions & 1 deletion pkgs/top-level/linux-kernels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,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 { };

Expand Down Expand Up @@ -611,6 +611,7 @@ in {
xmm7360-pci = throw "Support for the XMM7360 WWAN card was added to the iosm kmod in mainline kernel version 5.18";
amdgpu-pro = throw "amdgpu-pro was removed due to lack of maintenance"; # Added 2024-06-16
kvdo = throw "kvdo was removed, because it was added to mainline in kernel version 6.9"; # Added 2024-07-08
tuxedo-keyboard = self.tuxedo-drivers;
});

hardenedPackagesFor = kernel: overrides: packagesFor (hardenedKernelFor kernel overrides);
Expand Down