{ config, pkgs, lib, ... }:
{
	programs.steam.enable = true;
  programs.steam.remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
  programs.steam.dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server

  # TODO: gamescope?
  # TODO: gamemode?

  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "steam"
    "steam-original"
    "steam-runtime"
  ];

  /** /
  #programs.java.enable = true;
  nixpkgs.config.packageOverrides = pkgs: {
    steam = pkgs.steam.override {
      #withPrimus = config.hardware.nvidia.modesetting.enable;
      #withJava = config.programs.java.enable;

			#nativeOnly = true;
      #newStdcpp = true;
			#extraProfile = "export SDL_VIDEODRIVER=x11";
      extraPkgs = pkgs: with pkgs; [
				config.hardware.opengl.package
				nettools # some scripts expect 'hostname'
        glxinfo # for debugging

        pipewire

        libgdiplus
        libpng
        libpulseaudio
        libvorbis
        libbsd
        gnutls

        zlib
        mono
        cairo
        pango
        cabextract

        lsb-release
        fontconfig
        gdk-pixbuf
				gtk3
				gtk3-x11

        xorg.libXcursor
        xorg.libXi
        xorg.libXinerama
        xorg.libXScrnSaver
        xorg.libxcb

	      stdenv.cc.cc.lib
	      #libkrb5
	      #keyutils
	    ];
    };
  };
  /**/

	#services.joycond.enable = true;

	hardware.opengl.enable = true;
	hardware.opengl.driSupport = true;
	hardware.opengl.driSupport32Bit = true;
	hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];

  environment.systemPackages = with pkgs; [
    steam-tui
    steamcmd
    #winetricks
    #protontricks

    wineWowPackages.full
    #wineWowPackages.waylandFull

    # nice to have
    jstest-gtk
    antimicrox

    # since gnome doesn't let me select the provided [Desktop Action BigPicture]
    # in the overview without right clicking /shrug
    (makeDesktopItem {
      desktopName = "Steam Big Picture";
      name = "Steam";
      exec = "steam steam://open/bigpicture";
      icon = "steam";
    })
  ];

}
