summaryrefslogtreecommitdiff
path: root/modules/nixos/games/default.nix
blob: 78aae62898248328981f1e8552831705fe63c290 (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
{
  config,
  lib,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.games;
in {
  imports = [
    ./gamemode.nix
    ./lutris.nix
    ./mangohud.nix
    ./minecraft.nix
    ./steam-run.nix
    ./steam.nix
  ];

  options.nixfiles.modules.games.enable32BitSupport =
    mkEnableOption "support for games";

  config = mkIf cfg.enable32BitSupport {
    services = {
      jack.alsa.support32Bit = config.services.jack.alsa.enable;

      pipewire.alsa.support32Bit = config.services.pipewire.alsa.enable;
    };

    hardware = {
      opengl = mkIf config.hardware.opengl.enable {
        extraPackages32 = config.hardware.opengl.extraPackages;
        driSupport32Bit = config.hardware.opengl.driSupport;
      };

      pulseaudio.support32Bit = config.hardware.pulseaudio.enable;
    };
  };
}