43 lines
1.1 KiB
Nix
43 lines
1.1 KiB
Nix
{
|
|
inputs,
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
system,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.hardware.bosto-touchpad;
|
|
in
|
|
{
|
|
options.hardware.bosto-touchpad.enable = lib.mkOption {
|
|
type = with lib.types; uniq bool;
|
|
default = false;
|
|
description = "Enable Bosto Touchpad Support";
|
|
};
|
|
|
|
config = lib.mkIf (cfg.enable) {
|
|
|
|
# boot.kernelModules = [ "hid-magicmouse" ];
|
|
|
|
# Add Driver Options to extra ModprobeConfig, to support reloading hid-magicmouse
|
|
boot.extraModprobeConfig = ''
|
|
options hid-magicmouse emulate_scroll_wheel=Y emulate_3button=Y middle_click_3finger=Y scroll_acceleration=Y scroll_speed=10
|
|
'';
|
|
|
|
# Service to load Driver with options
|
|
systemd.services."bostoService" = {
|
|
description = "Bosto Touchpad Service";
|
|
path = [ pkgs.kmod ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = ''
|
|
${pkgs.kmod.out}/bin/modprobe -r hid-magicmouse
|
|
${pkgs.kmod.out}/bin/modprobe hid-magicmouse emulate_scroll_wheel=Y emulate_3button=Y middle_click_3finger=Y scroll_acceleration=Y scroll_speed=10
|
|
'';
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
};
|
|
}
|
|
|