1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7 cfg = config.hardware.steam-hardware;
8
9in
10
11{
12 options.hardware.steam-hardware = {
13 enable = mkOption {
14 type = types.bool;
15 default = false;
16 description = "Enable udev rules for Steam hardware such as the Steam Controller, other supported controllers and the HTC Vive";
17 };
18 };
19
20 config = mkIf cfg.enable {
21 services.udev.packages = [
22 pkgs.steamPackages.steam
23 ];
24
25 # The uinput module needs to be loaded in order to trigger the udev rules
26 # defined in the steam package for setting permissions on /dev/uinput.
27 #
28 # If the udev rules are not triggered, some controllers won't work with
29 # steam.
30 boot.kernelModules = [ "uinput" ];
31 };
32}