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

Add support for tuxedo-keyboard LED backlighting. #73885

Closed
wants to merge 4 commits into from
Closed

Add support for tuxedo-keyboard LED backlighting. #73885

wants to merge 4 commits into from

Conversation

blanky0230
Copy link
Member

Motivation for this change

Additional hardware-support for another hardware vendor.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • [] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @zimbatm I have some doubts whether this needs a module at all now, since most things I had to be "configurable" via the module might as well just be set by the user directly. wdyt?

@blanky0230 blanky0230 changed the title WINixos tuxedo keyboard WIP: Add support for tuxedo-keyboard LED backlighting. Nov 21, 2019
Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

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

Nice work! I left a few comments. Once you are finished with those, let's get some more people involved.

nixos/modules/hardware/tuxedo-keyboard.nix Outdated Show resolved Hide resolved
nixos/modules/hardware/tuxedo-keyboard.nix Outdated Show resolved Hide resolved
nixos/modules/hardware/tuxedo-keyboard.nix Outdated Show resolved Hide resolved
nixos/modules/hardware/tuxedo-keyboard.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
@@ -0,0 +1,32 @@
{ stdenv, fetchFromGitHub, kernel, kmod }:

# TODO: look at the other kernel modules packages and see if you find improvements to do
Copy link
Member Author

Choose a reason for hiding this comment

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

That part at installPhase seems still a bit off. Creating a directory just to move some artefact away seems redundant. Maybe I could find some way to direclty output the module to $out/lib/modules/${kernel.modDirVersion}.

nixos/modules/hardware/tuxedo-keyboard.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/tuxedo-keyboard/default.nix Outdated Show resolved Hide resolved
@@ -944,6 +944,11 @@
githubId = 5718007;
name = "Bastian Köcher";
};
blanky0230 = {
email = "blanky0230@gmail.com";
github = "blanky0230";
Copy link
Member

Choose a reason for hiding this comment

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

githubId missing, see top of this file

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I wasn't aware that it now is required :)

nixos/modules/hardware/tuxedo-keyboard.nix Outdated Show resolved Hide resolved
"tuxedo_keyboard.brightness=255"
"tuxedo_keyboard.color_left=0xff0a0a"
];
</option>
Copy link
Member

Choose a reason for hiding this comment

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

There's <programlisting></programlisting> to render multiple lines of code

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good tip! :)

nixos/modules/hardware/tuxedo-keyboard.nix Outdated Show resolved Hide resolved
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: <link xlink:href="https://github.com/tuxedocomputers/tuxedo-keyboard#kernelparam" />

In order to use the 'custom' lighting with the maximumg brightness and a color of '0xff0a0a' one would put pass <literal>boot.kernelParams</literal> like this:
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't these 'custom' ones be <literal>custom</literal>? Same for the hex value

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Makes it more readable in the HTML output.

nixos/modules/hardware/tuxedo-keyboard.nix Show resolved Hide resolved
Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

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

Looking good to me, only thing left to do is to clean up the history, with three subsequent commits

  • One for adding yourself as a maintainer
  • One for adding the package
  • And one for the NixOS module

@blanky0230
Copy link
Member Author

ping @infinisil wdyt? Please let me know if there's something more to do here :) Thank you!

@blanky0230 blanky0230 changed the title WIP: Add support for tuxedo-keyboard LED backlighting. Add support for tuxedo-keyboard LED backlighting. Jan 18, 2020
@infinisil
Copy link
Member

The merge commit should be removed from the history now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants