{
  pkgs,
  lib,
  config,
  ...
}:
{
  config = lib.mkIf config.programs.steam.enable {
    programs.gamescope = {
      enable = true;
      capSysNice = true;
    };

    environment = {
      systemPackages = [ pkgs.mangohud ];
    };

    programs.steam = {
      gamescopeSession.enable = true; # Adds a steam entry to the login manager
      extest.enable = true;
      localNetworkGameTransfers.openFirewall = true;
      extraCompatPackages = with pkgs; [ proton-ge-bin ];
    };
  };
}
