# Steam + Proton, gamescope, gamemode and MangoHud. The owner joins the # `gamemode` group (created by programs.gamemode) so gamemoderun may renice and # tune the GPU. { config, ... }: let inherit (config.meta) owner; in { flake.modules.nixos.gaming = { pkgs, ... }: { programs = { steam = { enable = true; remotePlay.openFirewall = true; localNetworkGameTransfers.openFirewall = true; dedicatedServer.openFirewall = false; gamescopeSession.enable = true; extraCompatPackages = [ pkgs.proton-ge-bin ]; protontricks.enable = true; # Steam Input on Wayland (controllers acting as keyboard/mouse). extest.enable = true; }; gamescope = { enable = false; # Lets gamescope raise its own priority. capSysNice = true; }; gamemode = { enable = true; settings = { general.renice = 10; gpu = { apply_gpu_optimisations = "accept-responsibility"; gpu_device = 0; amd_performance_level = "high"; }; }; }; }; hardware.steam-hardware.enable = true; environment.systemPackages = with pkgs; [ mangohud protonplus ]; # Some Proton games exhaust the default map count and crash. boot.kernel.sysctl."vm.max_map_count" = 2147483642; boot.kernel.sysctl."net.ipv4.conf.eth0.forwarding" = 1; boot.kernel.sysctl."net.ipv4.conf.enp16s0.forwarding" = 1; users.users.${owner.name}.extraGroups = [ "gamemode" ]; }; }