summaryrefslogtreecommitdiff
path: root/system/gaming/steam.nix
blob: ada0aaf17124103b4989d92d3abfc006b4ea5a6f (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
35
36
37
38
39
40
{
  lib,
  config,
  ...
}: let
  inherit (lib) mkIf;
  cfg = config.gaming.steam;
in {
  config = mkIf cfg.enable {
    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;

    # cod
    networking.firewall = {
      allowedTCPPorts = [3074];
      allowedUDPPorts = [3074];
    };
  };
}