Files
nixos/modules/home/gaming.nix
T
2026-02-26 18:50:15 -06:00

80 lines
1.8 KiB
Nix

{
pkgs,
lib,
myConfig,
...
}: let
games = [
"Deadlock"
"project8"
"citadel"
];
mkGameRules = selector: [
"monitor 0, ${selector}"
"workspace name:gaming, ${selector}"
"fullscreen, ${selector}"
"immediate, ${selector}"
"stayfocused, ${selector}"
];
manualGameRules = lib.flatten (map (
game:
(mkGameRules "title:^(${game})$")
++ (mkGameRules "class:^(${game})$")
)
games);
in {
home.packages = with pkgs; [
protonup-qt
protontricks
mangohud
via
];
programs.mangohud = {
enable = true;
settings = {
full = true;
no_display = true; # Don't show by default (toggle with Shift+F12)
cpu_temp = true;
gpu_temp = true;
ram = true;
vram = true;
};
};
wayland.windowManager.hyprland.settings = {
workspace = [
"name:gaming, monitor:0, default:true"
];
exec-once = [
"[workspace special:steam silent] uwsm app -- steam"
];
bindd = [
"SUPER, T, Toggle Steam, togglespecialworkspace, steam"
"SUPER SHIFT, T, Move to Steam Special Workspace, movetoworkspace, special:steam"
"SUPER, G, Switch to Gaming Workspace, workspace, name:gaming"
];
windowrulev2 =
[
# --- STEAM LAUNCHER RULES ---
"workspace special:steam silent, class:^(steam)$"
"noinitialfocus, class:^(steam)$"
"suppressevent activate, class:^(steam)$"
]
# --- AUTO-DETECTED GAMES ---
++ (mkGameRules "class:^steam_app_\\d+$")
++ (mkGameRules "class:^(gamescope)$")
++ (mkGameRules "class:^(lutris)$")
++ (mkGameRules "class:^(heroic)$")
++ (mkGameRules "class:^wine-.*$")
++ (mkGameRules "title:^Wine .*$")
# --- MANUAL GAMES ---
++ manualGameRules;
};
}