feat(keyboard): add enable option

This commit is contained in:
2026-05-22 20:19:57 +02:00
parent c6ea1433d3
commit ac4e8aacbd

View File

@@ -1,19 +1,28 @@
{ pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
with pkgs;
let
tools = interception-tools;
inherit (interception-tools-plugins) caps2esc;
cfg = config.keyboard;
tools = pkgs.interception-tools;
inherit (pkgs.interception-tools-plugins) caps2esc;
in
{
services.interception-tools = {
enable = true;
plugins = [ caps2esc ];
udevmonConfig = ''
- JOB: ${tools}/bin/intercept -g $DEVNODE | ${caps2esc}/bin/caps2esc -m 1 | ${tools}/bin/uinput -d $DEVNODE
DEVICE:
EVENTS:
EV_KEY: [KEY_CAPSLOCK]
'';
options.keyboard.enable = lib.mkEnableOption "keyboard remapping";
config = lib.mkIf cfg.enable {
services.interception-tools = {
enable = true;
plugins = [ caps2esc ];
udevmonConfig = ''
- JOB: ${tools}/bin/intercept -g $DEVNODE | ${caps2esc}/bin/caps2esc -m 1 | ${tools}/bin/uinput -d $DEVNODE
DEVICE:
EVENTS:
EV_KEY: [KEY_CAPSLOCK]
'';
};
};
}