2018-09-30 10:59:57 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.hardware.steam-hardware;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options.hardware.steam-hardware = {
|
2024-08-24 22:05:30 +02:00
|
|
|
enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
2018-09-30 10:59:57 +02:00
|
|
|
default = false;
|
|
|
|
description = "Enable udev rules for Steam hardware such as the Steam Controller, other supported controllers and the HTC Vive";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-24 22:05:30 +02:00
|
|
|
config = lib.mkIf cfg.enable {
|
2018-09-30 10:59:57 +02:00
|
|
|
services.udev.packages = [
|
2024-12-08 19:04:46 +08:00
|
|
|
pkgs.steam-devices-udev-rules
|
2018-09-30 10:59:57 +02:00
|
|
|
];
|
2019-10-06 11:34:54 +09:00
|
|
|
|
|
|
|
# The uinput module needs to be loaded in order to trigger the udev rules
|
|
|
|
# defined in the steam package for setting permissions on /dev/uinput.
|
|
|
|
#
|
|
|
|
# If the udev rules are not triggered, some controllers won't work with
|
|
|
|
# steam.
|
|
|
|
boot.kernelModules = [ "uinput" ];
|
2018-09-30 10:59:57 +02:00
|
|
|
};
|
|
|
|
}
|