{ lib, pkgs, config, ... }: let inherit (lib) mkIf mkEnableOption; cfg = config.modules.system.roles.gaming; in { options.modules.system.roles.gaming = { enable = mkEnableOption "gaming features"; minecraft.enable = mkEnableOption "minecraft"; }; config = mkIf cfg.enable { programs.gamescope = { enable = true; capSysNice = true; }; programs.steam = { enable = true; extest.enable = true; localNetworkGameTransfers.openFirewall = true; extraCompatPackages = with pkgs; [ proton-ge-bin ]; }; programs.gamemode.enable = true; environment.systemPackages = with pkgs; [ mangohud heroic (mkIf cfg.minecraft.enable prismlauncher) ]; }; }