mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
Add options to configure xpadneo kernel module parameters: - settings: freeform attrset for any kernel module parameter (disable_deadzones, trigger_rumble_mode, disable_shift_mode, etc.) - rumbleAttenuation: convenience option with overall/triggers submodule for force feedback attenuation - quirks: convenience option mapping MAC addresses to quirk flags The NixOS test is extended to provide basic sanity checks on the generated modprobe configuration.
34 lines
1 KiB
Nix
34 lines
1 KiB
Nix
{ lib, pkgs, ... }:
|
|
{
|
|
name = "xpadneo";
|
|
meta.maintainers = with lib.maintainers; [ kira-bruneau ];
|
|
|
|
nodes = {
|
|
machine = {
|
|
config.hardware.xpadneo = {
|
|
enable = true;
|
|
rumbleAttenuation = {
|
|
overall = 50;
|
|
triggers = 25;
|
|
};
|
|
settings = {
|
|
disable_deadzones = 1;
|
|
trigger_rumble_mode = 2;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
# This is just a sanity check to make sure the module was
|
|
# loaded. We'd have to find some way to mock an xbox controller if
|
|
# we wanted more in-depth testing.
|
|
testScript = ''
|
|
machine.start();
|
|
machine.succeed("modinfo hid_xpadneo | grep 'version:\s\+${pkgs.linuxPackages.xpadneo.version}'")
|
|
|
|
machine.succeed("grep 'options hid_xpadneo' /etc/modprobe.d/nixos.conf")
|
|
machine.succeed("grep 'disable_deadzones=1' /etc/modprobe.d/nixos.conf")
|
|
machine.succeed("grep 'trigger_rumble_mode=2' /etc/modprobe.d/nixos.conf")
|
|
machine.succeed("grep 'rumble_attenuation=50,25' /etc/modprobe.d/nixos.conf")
|
|
'';
|
|
}
|