{ pkgs, lib, config, ... }: {
  options.mods.desktop.gaming.enable =
    lib.mkEnableOption "enables entertainment programs";

  config = lib.mkIf config.mods.desktop.gaming.enable {
    programs.gamemode.enable = true;
    users.users.${config.mods.user.name}.extraGroups =
      lib.mkAfter [ "gamemode" ];

    networking.firewall.allowedTCPPorts = [ 3075 34000 ];
    networking.firewall.allowedTCPPortRanges = [
      {
        from = 27015;
        to = 27030;
      }
      {
        from = 27036;
        to = 27037;
      }
    ];

    networking.firewall.allowedUDPPorts = [ 3075 4380 27036 34000 ];
    networking.firewall.allowedUDPPortRanges = [{
      from = 27000;
      to = 27031;
    }];
  };
}
