Skip to content

Commit 93262b6

Browse files
committed
feat(hardware): add gamepad controller support module
steam-hardware only covers Steam Input. Add xpadneo (Xbox wireless-over-Bluetooth), game-devices-udev-rules (DualSense/DualShock udev permissions), and joycond (Joy-Con/Switch Pro) as independent toggles under khanelinix.hardware.controllers, enabled game suite.
1 parent 442c50f commit 93262b6

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
7+
let
8+
inherit (lib) mkIf mkEnableOption mkMerge;
9+
10+
cfg = config.khanelinix.hardware.controllers;
11+
in
12+
{
13+
options.khanelinix.hardware.controllers = {
14+
xpadneo.enable = mkEnableOption "xpadneo driver for Xbox wireless-over-Bluetooth controllers";
15+
playstation.enable = mkEnableOption "udev rules for PlayStation DualSense/DualShock controllers";
16+
joycon.enable = mkEnableOption "joycond support for Nintendo Joy-Con/Switch Pro controllers";
17+
};
18+
19+
config = mkMerge [
20+
(mkIf cfg.xpadneo.enable {
21+
hardware.xpadneo.enable = true;
22+
})
23+
(mkIf cfg.playstation.enable {
24+
services.udev.packages = [ pkgs.game-devices-udev-rules ];
25+
})
26+
(mkIf cfg.joycon.enable {
27+
services.joycond.enable = true;
28+
})
29+
];
30+
}

modules/nixos/suites/games/default.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ in
2323

2424
config = lib.mkIf cfg.enable {
2525
khanelinix = {
26+
hardware.controllers = lib.mkIf (includes "standard") (mkDefault {
27+
xpadneo.enable = true;
28+
playstation.enable = true;
29+
joycon.enable = true;
30+
});
31+
2632
programs = {
2733
graphical = {
2834
addons = {

0 commit comments

Comments
 (0)