From 30240a59fe5f6eecc61830ed9a0a588c91677e68 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Fri, 28 Sep 2018 09:34:37 +0200 Subject: [PATCH 1/4] steamPackages.steam: add udev rules --- pkgs/games/steam/steam.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/games/steam/steam.nix b/pkgs/games/steam/steam.nix index b8e1982a989..d0b221c5133 100644 --- a/pkgs/games/steam/steam.nix +++ b/pkgs/games/steam/steam.nix @@ -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; { From 7af3a85d8d1a91b57b6cdee0b2e5d88981f310fa Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Fri, 28 Sep 2018 14:38:56 +0200 Subject: [PATCH 2/4] steamPackages.steam: 1.0.0.51 -> 1.0.0.56 --- pkgs/games/steam/steam.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/games/steam/steam.nix b/pkgs/games/steam/steam.nix index d0b221c5133..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=" ]; From da86afba0d610170993eef053f534afc469269a3 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Sun, 30 Sep 2018 10:59:57 +0200 Subject: [PATCH 3/4] nixos/steam-hardware: module init --- nixos/modules/hardware/steam-hardware.nix | 25 +++++++++++++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 26 insertions(+) create mode 100644 nixos/modules/hardware/steam-hardware.nix 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 1a8f522a969..fe2cbb23476 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 From d859a66351181bf63d2f311269e2b71bf949e166 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Sun, 30 Sep 2018 11:27:33 +0200 Subject: [PATCH 4/4] nixos/steam-hardware: update documentation --- doc/package-notes.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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.