feat(hardware): move hardware inputs to dedicated module

This commit is contained in:
2025-11-07 02:26:13 +01:00
parent fc2407940c
commit 1aef3db69d
8 changed files with 32 additions and 14 deletions

View File

@@ -2,9 +2,7 @@
imports = [
./amdgpu.nix
./bluetooth.nix
./corne.nix
./ibm-trackpoint.nix
./opentablet.nix
./sound.nix
./input
];
}

View File

@@ -4,9 +4,9 @@
...
}:
with lib; let
cfg = config.mySystem.hardware.corne;
cfg = config.mySystem.hardware.input.corne;
in {
options.mySystem.hardware.corne.allowHidAccess = mkEnableOption "Enable HID access to the corne keyboard";
options.mySystem.hardware.input.corne.allowHidAccess = mkEnableOption "Enable HID access to the corne keyboard";
config.services.udev = mkIf cfg.allowHidAccess {
extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{serial}=="*vial:f64c2b3c*", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"

View File

@@ -0,0 +1,8 @@
{
imports = [
./corne.nix
./ibm-trackpoint.nix
./opentablet.nix
./trackball.nix
];
}

View File

@@ -4,9 +4,9 @@
...
}:
with lib; let
cfg = config.mySystem.hardware.ibmTrackpoint;
cfg = config.mySystem.hardware.input.ibmTrackpoint;
in {
options.mySystem.hardware.ibmTrackpoint.disable = mkEnableOption "Disable IBMs trackpoint on ThinkPad";
options.mySystem.hardware.input.ibmTrackpoint.disable = mkEnableOption "Disable IBMs trackpoint on ThinkPad";
config.services.udev = mkIf cfg.disable {
extraRules = ''
ATTRS{name}=="*TPPS/2 IBM TrackPoint", ENV{ID_INPUT}="", ENV{ID_INPUT_MOUSE}="", ENV{ID_INPUT_POINTINGSTICK}=""

View File

@@ -4,9 +4,9 @@
...
}:
with lib; let
cfg = config.mySystem.hardware.opentablet;
cfg = config.mySystem.hardware.input.opentablet;
in {
options.mySystem.hardware.opentablet.enable = mkEnableOption "Enables OpenTablet drivers";
options.mySystem.hardware.input.opentablet.enable = mkEnableOption "Enables OpenTablet drivers";
config.hardware.opentabletdriver = mkIf cfg.enable {
inherit (cfg) enable;
daemon.enable = true;

View File

@@ -0,0 +1,3 @@
{
services.libinput.mouse.middleEmulation = true;
}