From 6ef84bc71250fa1c2d1b31cc99b4c3632f7d8247 Mon Sep 17 00:00:00 2001 From: Lumpiasty Date: Sat, 23 Aug 2025 20:19:28 +0200 Subject: [PATCH] fps limiting in mangohud --- home-modules/gaming.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/home-modules/gaming.nix b/home-modules/gaming.nix index 50b8419..54080cf 100644 --- a/home-modules/gaming.nix +++ b/home-modules/gaming.nix @@ -1,13 +1,25 @@ { config, lib, pkgs, osConfig, ... }: -{ +let + # https://raw.githubusercontent.com/flightlessmango/MangoHud/master/data/MangoHud.conf + mangohudConfig = pkgs.writeText "mangohud.conf" '' + fps_limit=0,60,90,120,240 + show_fps_limit + ''; + + mangohudWrapped = (pkgs.runCommand + "mangohud" + { nativeBuildInputs = [ pkgs.makeWrapper ]; } + "makeWrapper ${pkgs.mangohud}/bin/mangohud $out/bin/mangohud --set MANGOHUD_CONFIGFILE ${mangohudConfig}" + ); +in { options.lumpiastyHome.gaming = lib.mkEnableOption "Gaming account"; config = lib.mkIf config.lumpiastyHome.gaming { programs.lutris = { enable = true; extraPackages = with pkgs; [ - mangohud + mangohudWrapped gamescope ]; }; @@ -18,7 +30,7 @@ ]; })) (steam.override { - extraPkgs = pkgs': with pkgs'; [ mangohud gamescope ]; + extraPkgs = pkgs': with pkgs'; [ mangohudWrapped gamescope ]; }) ]; };