feat(hardware): move hardware inputs to dedicated module
This commit is contained in:
@@ -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";
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"
|
||||||
8
system/hardware/input/default.nix
Normal file
8
system/hardware/input/default.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./corne.nix
|
||||||
|
./ibm-trackpoint.nix
|
||||||
|
./opentablet.nix
|
||||||
|
./trackball.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -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 IBM’s trackpoint on ThinkPad";
|
options.mySystem.hardware.input.ibmTrackpoint.disable = mkEnableOption "Disable IBM’s 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}=""
|
||||||
@@ -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;
|
||||||
3
system/hardware/input/trackball.nix
Normal file
3
system/hardware/input/trackball.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
services.libinput.mouse.middleEmulation = true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user