summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorblanky0230 <blanky0230@gmail.com>2019-11-21 23:10:41 +0100
committerblanky0230 <blanky0230@gmail.com>2020-01-26 09:24:09 +0100
commitf2fea8894dae30ae1cc46c70302a9cc7d54a6ea4 (patch)
treeb2d01434e5d53f1306ae835b2de3bca227cb5352 /nixos
parent4cf316f5bd952507e6a7159e4a7b245618aedb5e (diff)
downloadnixpkgs-f2fea8894dae30ae1cc46c70302a9cc7d54a6ea4.tar
nixpkgs-f2fea8894dae30ae1cc46c70302a9cc7d54a6ea4.tar.gz
nixpkgs-f2fea8894dae30ae1cc46c70302a9cc7d54a6ea4.tar.bz2
nixpkgs-f2fea8894dae30ae1cc46c70302a9cc7d54a6ea4.tar.lz
nixpkgs-f2fea8894dae30ae1cc46c70302a9cc7d54a6ea4.tar.xz
nixpkgs-f2fea8894dae30ae1cc46c70302a9cc7d54a6ea4.tar.zst
nixpkgs-f2fea8894dae30ae1cc46c70302a9cc7d54a6ea4.zip
nixos/tuxedo-keyboard: init module.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/hardware/tuxedo-keyboard.nix35
-rw-r--r--nixos/modules/module-list.nix1
2 files changed, 36 insertions, 0 deletions
diff --git a/nixos/modules/hardware/tuxedo-keyboard.nix b/nixos/modules/hardware/tuxedo-keyboard.nix
new file mode 100644
index 00000000000..898eed24493
--- /dev/null
+++ b/nixos/modules/hardware/tuxedo-keyboard.nix
@@ -0,0 +1,35 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let 
+  cfg = config.hardware.tuxedo-keyboard;
+  tuxedo-keyboard = config.boot.kernelPackages.tuxedo-keyboard;
+in
+  {
+    options.hardware.tuxedo-keyboard = {
+      enable = mkEnableOption ''
+          Enables the tuxedo-keyboard driver.
+
+          To configure the driver, pass the options to the <option>boot.kernelParams</option> configuration.
+          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 <literal>custom</literal> lighting with the maximumg brightness and a color of <literal>0xff0a0a</literal> one would put pass <option>boot.kernelParams</option> like this:
+
+          <programlisting>
+          boot.kernelParams = [
+           "tuxedo_keyboard.mode=0"
+           "tuxedo_keyboard.brightness=255"
+           "tuxedo_keyboard.color_left=0xff0a0a"
+          ];
+          </programlisting>
+      '';
+    };
+
+    config = mkIf cfg.enable 
+    {
+      boot.kernelModules = ["tuxedo_keyboard"];
+      boot.extraModulePackages = [ tuxedo-keyboard ];
+    };
+  }
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index eadf1d2d89b..8953ec03948 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -62,6 +62,7 @@
   ./hardware/printers.nix
   ./hardware/raid/hpsa.nix
   ./hardware/steam-hardware.nix
+  ./hardware/tuxedo-keyboard.nix
   ./hardware/usb-wwan.nix
   ./hardware/onlykey.nix
   ./hardware/video/amdgpu.nix