{ config, lib, pkgs, ... }: { options = { apps.gaming = { enable = lib.mkEnableOption "enable gaming"; steam.enable = lib.mkEnableOption "enable steam"; minecraft.enable = lib.mkEnableOption "enable minecraft"; }; }; config = { environment.systemPackages = with pkgs; [ ] ++ ( if (config.apps.gaming.enable) then [ cartridges (pkgs.lutris.override { # Intercept buildFHSEnv to modify target packages buildFHSEnv = args: pkgs.buildFHSEnv ( args // { multiPkgs = envPkgs: let # Fetch original package list originalPkgs = args.multiPkgs envPkgs; # Disable tests for openldap customLdap = envPkgs.openldap.overrideAttrs (_: { doCheck = false; }); in # Replace broken openldap with the custom one builtins.filter (p: (p.pname or "") != "openldap") originalPkgs ++ [ customLdap ]; } ); }) ] else [ ] ) ++ ( if (config.apps.gaming.minecraft.enable) then [ prismlauncher ] else [ ] ) ++ ( if (config.apps.gaming.steam.enable) then [ adwsteamgtk ] else [ ] ); programs = { steam = if config.apps.gaming.steam.enable then { enable = true; remotePlay.openFirewall = true; dedicatedServer.openFirewall = true; localNetworkGameTransfers.openFirewall = true; gamescopeSession.enable = true; protontricks.enable = true; extraCompatPackages = with pkgs; [ proton-ge-bin ]; extraPackages = with pkgs; [ gamescope ]; } else { }; gamescope = { enable = true; capSysNice = true; }; }; }; }