All tracked files were committed as 755; only Nix reads them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
58 lines
1.3 KiB
Nix
58 lines
1.3 KiB
Nix
# Steam + Proton, gamescope, gamemode and MangoHud.
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.my.gaming;
|
|
in
|
|
{
|
|
options.my.gaming.enable = lib.mkEnableOption "the gaming stack (Steam, Proton-GE, gamescope, gamemode)";
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
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;
|
|
};
|
|
}
|