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

@@ -34,9 +34,11 @@
}; };
hardware = { hardware = {
bluetooth.enable = true; bluetooth.enable = true;
input = {
corne.allowHidAccess = true; corne.allowHidAccess = true;
ibmTrackpoint.disable = true; ibmTrackpoint.disable = true;
opentablet.enable = true; opentablet.enable = true;
};
sound.enable = true; sound.enable = true;
}; };
misc.keymap = "fr-bepo"; misc.keymap = "fr-bepo";

View File

@@ -38,8 +38,10 @@
hardware = { hardware = {
amdgpu.enable = true; amdgpu.enable = true;
bluetooth.enable = true; bluetooth.enable = true;
input = {
corne.allowHidAccess = true; corne.allowHidAccess = true;
opentablet.enable = true; opentablet.enable = true;
};
sound = { sound = {
enable = true; enable = true;
jack = true; jack = true;
@@ -90,6 +92,11 @@
mode = "0440"; mode = "0440";
}; };
services.udev.extraHwdb = ''
mouse:usb:047d:80a6:*
LIBINPUT_MIDDLE_EMULATION_ENABLED=1
'';
security = { security = {
polkit.enable = true; polkit.enable = true;
rtkit.enable = true; rtkit.enable = true;

View File

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

View File

@@ -4,9 +4,9 @@
... ...
}: }:
with lib; let with lib; let
cfg = config.mySystem.hardware.corne; cfg = config.mySystem.hardware.input.corne;
in { 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 { config.services.udev = mkIf cfg.allowHidAccess {
extraRules = '' extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{serial}=="*vial:f64c2b3c*", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" 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 with lib; let
cfg = config.mySystem.hardware.ibmTrackpoint; cfg = config.mySystem.hardware.input.ibmTrackpoint;
in { 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 { config.services.udev = mkIf cfg.disable {
extraRules = '' extraRules = ''
ATTRS{name}=="*TPPS/2 IBM TrackPoint", ENV{ID_INPUT}="", ENV{ID_INPUT_MOUSE}="", ENV{ID_INPUT_POINTINGSTICK}="" 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 with lib; let
cfg = config.mySystem.hardware.opentablet; cfg = config.mySystem.hardware.input.opentablet;
in { 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 { config.hardware.opentabletdriver = mkIf cfg.enable {
inherit (cfg) enable; inherit (cfg) enable;
daemon.enable = true; daemon.enable = true;

View File

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