2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.hardware.steam-hardware;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options.hardware.steam-hardware = {
|
2024-09-19 14:19:46 +00:00
|
|
|
enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
2020-04-24 23:36:52 +00:00
|
|
|
default = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Enable udev rules for Steam hardware such as the Steam Controller, other supported controllers and the HTC Vive";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2020-04-24 23:36:52 +00:00
|
|
|
services.udev.packages = [
|
|
|
|
pkgs.steamPackages.steam
|
|
|
|
];
|
|
|
|
|
|
|
|
# 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" ];
|
|
|
|
};
|
|
|
|
}
|