Files
nixpkgs/nixos/tests/xpadneo.nix
Dyego Aurélio fc1740caaf nixos/xpadneo: add module parameter configuration options
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.
2026-02-12 01:01:08 -03:00

35 lines
1.0 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")
'';
}