summaryrefslogtreecommitdiff
path: root/modules/gaming/steam.nix
blob: 53ab25288bc144907aa56e70653012f733f5a837 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  lib,
  config,
  ...
}: let
  inherit (lib) mkIf;
  cfg = config.gaming;
in {
  config = mkIf cfg.steam {
    nixpkgs.config.allowUnfreePredicate = pkg:
      builtins.elem (lib.getName pkg) [
        "steam"
        "steam-original"
        "steam-runtime"
      ];

    programs.gamescope = {
      enable = true;
      capSysNice = true;
    };

    programs.steam = {
      enable = true;
      remotePlay.openFirewall = true;
      dedicatedServer.openFirewall = true;
      localNetworkGameTransfers.openFirewall = true;
      gamescopeSession.enable = true;
    };

    # controllers
    hardware.xone.enable = true;
    hardware.steam-hardware.enable = true;
  };
}