{ config, lib, pkgs, util, ... }: # Steam game launcher and runtime integration. let steamVrLauncher = "/home/${config.user.name}/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher"; in { options.modules.desktop.apps.steam.enable = lib.mkEnableOption "Steam game launcher"; config = lib.mkIf config.modules.desktop.apps.steam.enable { programs.gamemode.enable = true; programs.steam = { enable = true; package = pkgs.steam.override { extraEnv.STEAM_FORCE_DESKTOPUI_SCALING = "1.5"; }; }; hardware.steam-hardware.enable = true; programs.gamescope = { enable = true; capSysNice = true; }; networking.firewall.allowedUDPPorts = [ 10400 ]; systemd.paths.steamvr-capabilities = { wantedBy = [ "multi-user.target" ]; pathConfig = { PathChanged = steamVrLauncher; Unit = "steamvr-capabilities.service"; }; }; systemd.services.steamvr-capabilities = { wantedBy = [ "multi-user.target" ]; path = [ pkgs.libcap ]; script = '' setcap cap_sys_nice=eip ${lib.escapeShellArg steamVrLauncher} ''; serviceConfig.Type = "oneshot"; }; registry.window-icon.${config.networking.hostName}.steam = { class = "[Ss]team"; icon = util.glyph "f1b6"; }; }; }