about summary refs log tree commit diff
path: root/modules/games/steam.nix
blob: 9d41b8f25c80643cae40538348fe6a00a7665a66 (plain) (blame)
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
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.nixfiles.modules.games.steam;
in
{
  options.nixfiles.modules.games.steam.enable = lib.mkEnableOption "Steam runtime";

  config = lib.mkIf cfg.enable {
    nixfiles.modules = {
      common = {
        nix.allowedUnfreePackages = [
          "steam"
          "steam-run"
          "steam-unwrapped"
        ];

        xdg.defaultApplications.steam = [ "x-scheme-handler/steam" ];
      };

      games = {
        enable32BitSupport = true;
        gamemode.enable = true;
        mangohud.enable = true;
      };
    };

    hm.home.packages = with pkgs; [
      (steam.override { extraEnv.MANGOHUD = 1; })
      protontricks
    ];
  };
}

Consider giving Nix/NixOS a try! <3