2019-11-21 22:10:41 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2020-08-07 13:43:58 +00:00
|
|
|
let
|
2019-11-21 22:10:41 +00:00
|
|
|
cfg = config.hardware.tuxedo-keyboard;
|
|
|
|
tuxedo-keyboard = config.boot.kernelPackages.tuxedo-keyboard;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.hardware.tuxedo-keyboard = {
|
2022-08-30 12:08:50 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc ''
|
2019-11-21 22:10:41 +00:00
|
|
|
Enables the tuxedo-keyboard driver.
|
|
|
|
|
2022-08-30 12:08:50 +00:00
|
|
|
To configure the driver, pass the options to the {option}`boot.kernelParams` configuration.
|
2019-11-21 22:10:41 +00:00
|
|
|
There are several parameters you can change. It's best to check at the source code description which options are supported.
|
2022-08-30 12:08:50 +00:00
|
|
|
You can find all the supported parameters at: <https://github.com/tuxedocomputers/tuxedo-keyboard#kernelparam>
|
2019-11-21 22:10:41 +00:00
|
|
|
|
2022-08-30 12:08:50 +00:00
|
|
|
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:
|
2019-11-21 22:10:41 +00:00
|
|
|
|
2022-08-30 12:08:50 +00:00
|
|
|
```
|
2019-11-21 22:10:41 +00:00
|
|
|
boot.kernelParams = [
|
|
|
|
"tuxedo_keyboard.mode=0"
|
|
|
|
"tuxedo_keyboard.brightness=255"
|
|
|
|
"tuxedo_keyboard.color_left=0xff0a0a"
|
|
|
|
];
|
2022-08-30 12:08:50 +00:00
|
|
|
```
|
|
|
|
'');
|
2019-11-21 22:10:41 +00:00
|
|
|
};
|
|
|
|
|
2020-08-07 13:43:58 +00:00
|
|
|
config = mkIf cfg.enable
|
2019-11-21 22:10:41 +00:00
|
|
|
{
|
|
|
|
boot.kernelModules = ["tuxedo_keyboard"];
|
|
|
|
boot.extraModulePackages = [ tuxedo-keyboard ];
|
|
|
|
};
|
|
|
|
}
|