diff --git a/doc/package-notes.xml b/doc/package-notes.xml
index d8f55ef0a85..a4322a0234d 100644
--- a/doc/package-notes.xml
+++ b/doc/package-notes.xml
@@ -413,11 +413,8 @@ packageOverrides = pkgs: {
in your /etc/nixos/configuration.nix. You'll also need
hardware.pulseaudio.support32Bit = true;
if you are using PulseAudio - this will enable 32bit ALSA apps integration.
- To use the Steam controller, you need to add
-services.udev.extraRules = ''
- SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"
- KERNEL=="uinput", MODE="0660", GROUP="users", OPTIONS+="static_node=uinput"
- '';
+ To use the Steam controller or other Steam supported controllers such as the DualShock 4 or Nintendo Switch Pro, you need to add
+hardware.steam-hardware.enable = true;
to your configuration.
diff --git a/nixos/modules/hardware/steam-hardware.nix b/nixos/modules/hardware/steam-hardware.nix
new file mode 100644
index 00000000000..378aeffe71b
--- /dev/null
+++ b/nixos/modules/hardware/steam-hardware.nix
@@ -0,0 +1,25 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.hardware.steam-hardware;
+
+in
+
+{
+ options.hardware.steam-hardware = {
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ description = "Enable udev rules for Steam hardware such as the Steam Controller, other supported controllers and the HTC Vive";
+ };
+ };
+
+ config = mkIf cfg.enable {
+ services.udev.packages = [
+ pkgs.steamPackages.steam
+ ];
+ };
+}
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index f4c7cf601bf..87224fa6b51 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -46,6 +46,7 @@
./hardware/opengl.nix
./hardware/pcmcia.nix
./hardware/raid/hpsa.nix
+ ./hardware/steam-hardware.nix
./hardware/usb-wwan.nix
./hardware/onlykey.nix
./hardware/video/amdgpu.nix
diff --git a/pkgs/games/steam/steam.nix b/pkgs/games/steam/steam.nix
index b8e1982a989..dd6e9a070b1 100644
--- a/pkgs/games/steam/steam.nix
+++ b/pkgs/games/steam/steam.nix
@@ -2,14 +2,14 @@
let
traceLog = "/tmp/steam-trace-dependencies.log";
- version = "1.0.0.51";
+ version = "1.0.0.56";
in stdenv.mkDerivation rec {
name = "steam-original-${version}";
src = fetchurl {
url = "http://repo.steampowered.com/steam/pool/steam/s/steam/steam_${version}.tar.gz";
- sha256 = "1ghrfznm9rckm8v87zvh7hx820r5pp7sq575wxwq0fncbyq6sxmz";
+ sha256 = "01jgp909biqf4rr56kb08jkl7g5xql6r2g4ch6lc71njgcsbn5fs";
};
makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
@@ -25,6 +25,8 @@ in stdenv.mkDerivation rec {
EOF
chmod +x $out/bin/steamdeps
''}
+ install -d $out/lib/udev/rules.d
+ install -m644 lib/udev/rules.d/*.rules $out/lib/udev/rules.d
'';
meta = with stdenv.lib; {