nixos/preload: init
[NixPkgs.git] / nixos / modules / hardware / tuxedo-keyboard.nix
blobfd8b48a5e9eafce3cfea6d30cb1216cd9183b2a3
1 { config, lib, pkgs, ... }:
3 with lib;
5 let
6   cfg = config.hardware.tuxedo-keyboard;
7   tuxedo-keyboard = config.boot.kernelPackages.tuxedo-keyboard;
8 in
9   {
10     options.hardware.tuxedo-keyboard = {
11       enable = mkEnableOption (lib.mdDoc ''
12           the tuxedo-keyboard driver.
14           To configure the driver, pass the options to the {option}`boot.kernelParams` configuration.
15           There are several parameters you can change. It's best to check at the source code description which options are supported.
16           You can find all the supported parameters at: <https://github.com/tuxedocomputers/tuxedo-keyboard#kernelparam>
18           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:
20           ```
21           boot.kernelParams = [
22            "tuxedo_keyboard.mode=0"
23            "tuxedo_keyboard.brightness=255"
24            "tuxedo_keyboard.color_left=0xff0a0a"
25           ];
26           ```
27       '');
28     };
30     config = mkIf cfg.enable
31     {
32       boot.kernelModules = ["tuxedo_keyboard"];
33       boot.extraModulePackages = [ tuxedo-keyboard ];
34     };
35   }