From e9e868a4c5ce5295553e316fd13033ce321f6148 Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Sat, 11 Jul 2026 20:52:43 -0700 Subject: [PATCH] [xpadneo] Moved to it's own config. Adds an env var for steam. --- system/features/bluetooth.nix | 3 +++ system/features/xpadneo.nix | 26 +++++++++++++++++++ system/hosts/altair/default.nix | 1 + .../hosts/altair/hardware-configuration.nix | 18 ------------- 4 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 system/features/xpadneo.nix diff --git a/system/features/bluetooth.nix b/system/features/bluetooth.nix index 89d280e..1c87fd7 100644 --- a/system/features/bluetooth.nix +++ b/system/features/bluetooth.nix @@ -1,6 +1,9 @@ { pkgs, ... }: { + # Enable bluetooth. + hardware.bluetooth.enable = true; + # Install the management service and packages. environment.systemPackages = with pkgs; [ bluez ]; diff --git a/system/features/xpadneo.nix b/system/features/xpadneo.nix new file mode 100644 index 0000000..70159ea --- /dev/null +++ b/system/features/xpadneo.nix @@ -0,0 +1,26 @@ +_: { + hardware = { + # Wireless xbox controllers + xpadneo = { + enable = true; + settings = { + disable_mouse = 1; + }; + }; + + # Hardwired xbox controllers. + xone.enable = true; + }; + + # disable_ertm is required for xpadneo to connect properly and establish a + # data connection. enable_autosuspend is to prevent Linux from putting the + # BT radio to sleep and causing a disconnect. + boot.extraModprobeConfig = '' + options bluetooth disable_ertm=1 + options btusb enable_autosuspend=0 + ''; + + # Steam also needs HID API to be off so SDL will read directly from evdev, + # otherwise it won't get any events from xpadneo. + environment.sessionVariables.SDL_JOYSTICK_HIDAPI = "0"; +} diff --git a/system/hosts/altair/default.nix b/system/hosts/altair/default.nix index b89cc14..d6fc7ab 100644 --- a/system/hosts/altair/default.nix +++ b/system/hosts/altair/default.nix @@ -11,6 +11,7 @@ ../../features/gc.nix ../../features/gui.nix ../../features/virtualbox.nix + ../../features/xpadneo.nix ./configuration.nix ./hardware-configuration.nix ./qmk.nix diff --git a/system/hosts/altair/hardware-configuration.nix b/system/hosts/altair/hardware-configuration.nix index baa911f..004f3a5 100644 --- a/system/hosts/altair/hardware-configuration.nix +++ b/system/hosts/altair/hardware-configuration.nix @@ -32,14 +32,6 @@ }; kernelModules = [ "kvm-intel" ]; extraModulePackages = [ ]; - - # disable_ertm is required for xpadneo to connect properly and establish a - # data connection. enable_autosuspend is to prevent Linux from putting the - # BT radio to sleep and causing a disconnect. - extraModprobeConfig = '' - options bluetooth disable_ertm=1 - options btusb enable_autosuspend=0 - ''; }; fileSystems = { @@ -115,16 +107,6 @@ # Enable the nvidia-settings menu? nvidiaSettings = true; }; - # Wireless xbox controllers - xpadneo = { - enable = true; - settings = { - disable_mouse = 1; - }; - }; - # Hardwire xbox controllers. - xone.enable = true; - bluetooth.enable = true; }; # Add a udev rule to prevent the mouse from waking the system. Note that it