From 4eba766188b25baaf56a897daf42b6eb69ab3f4e Mon Sep 17 00:00:00 2001 From: GarandPLG Date: Sun, 14 Jun 2026 16:53:27 +0200 Subject: [PATCH] Add MangoHud module and enable it on hosts Introduce a new `mangohud.nix` module with sensible defaults, import it in `modules/home/default.nix`, and add a `mangohud.enable` flag to the host configurations (enabled for desktop and laptop, disabled for the default host). Comment out the default Gamescope arguments in `modules/core/steam.nix` and add a reference command line that includes the MangoHud flag. --- hosts/Garand-Desktop/home-modules.nix | 1 + hosts/Garand-Laptop/home-modules.nix | 1 + hosts/default/home-modules.nix | 1 + modules/core/steam.nix | 18 ++++--- modules/home/default.nix | 1 + modules/home/mangohud.nix | 72 +++++++++++++++++++++++++++ 6 files changed, 86 insertions(+), 8 deletions(-) create mode 100644 modules/home/mangohud.nix diff --git a/hosts/Garand-Desktop/home-modules.nix b/hosts/Garand-Desktop/home-modules.nix index af270a8..9fcc348 100644 --- a/hosts/Garand-Desktop/home-modules.nix +++ b/hosts/Garand-Desktop/home-modules.nix @@ -35,6 +35,7 @@ _: { Gaming */ lutris.enable = false; # Lutris: an open gaming platform + mangohud.enable = true; # MangoHud: Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more /* Media recording and streaming diff --git a/hosts/Garand-Laptop/home-modules.nix b/hosts/Garand-Laptop/home-modules.nix index ba9442f..57460d4 100644 --- a/hosts/Garand-Laptop/home-modules.nix +++ b/hosts/Garand-Laptop/home-modules.nix @@ -35,6 +35,7 @@ _: { Gaming */ lutris.enable = false; # Lutris: an open gaming platform + mangohud.enable = true; # MangoHud: Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more /* Media recording and streaming diff --git a/hosts/default/home-modules.nix b/hosts/default/home-modules.nix index 3393dcf..00b0c73 100644 --- a/hosts/default/home-modules.nix +++ b/hosts/default/home-modules.nix @@ -35,6 +35,7 @@ _: { Gaming */ lutris.enable = false; # Lutris: an open gaming platform + mangohud.enable = false; # MangoHud: Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more /* Media recording and streaming diff --git a/modules/core/steam.nix b/modules/core/steam.nix index ce3baae..a1cb83b 100644 --- a/modules/core/steam.nix +++ b/modules/core/steam.nix @@ -18,10 +18,10 @@ dedicatedServer.openFirewall = true; gamescopeSession = lib.mkIf config.gamescope.enable { enable = true; - args = [ - "--rt" - "--expose-wayland" - ]; + # args = [ + # "--rt" + # "--expose-wayland" + # ]; }; extraCompatPackages = [pkgs.proton-ge-bin]; }; @@ -29,10 +29,10 @@ gamescope = lib.mkIf config.gamescope.enable { enable = true; capSysNice = true; - args = [ - "--rt" - "--expose-wayland" - ]; + # args = [ + # # "--rt" + # # "--expose-wayland" + # ]; }; gamemode = lib.mkIf config.gamemode.enable { @@ -41,3 +41,5 @@ }; }; } +# gamescope -W 1920 -H 1080 -r 144 --force-grab-cursor -f --mangoapp --rt --expose-wayland -- + diff --git a/modules/home/default.nix b/modules/home/default.nix index 3f7c34b..daba246 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -24,6 +24,7 @@ _: { ./gtk.nix ./kdeConnect.nix ./lutris.nix + ./mangohud.nix ./nextcloud.nix ./obs-studio.nix ./ollama.nix diff --git a/modules/home/mangohud.nix b/modules/home/mangohud.nix new file mode 100644 index 0000000..b46a443 --- /dev/null +++ b/modules/home/mangohud.nix @@ -0,0 +1,72 @@ +{ + pkgs, + lib, + config, + ... +}: { + options.mangohud.enable = lib.mkEnableOption "MangoHud"; + + config = lib.mkIf config.mangohud.enable { + programs.mangohud = { + enable = true; + package = pkgs.mangohud; + settings = lib.mkForce { + position = "top-right"; + background_alpha = 0.4; + font_size = 18; + round_corners = 8; + no_display = 0; + + gpu_color = "2e9ef4"; + cpu_color = "39d353"; + vram_color = "ad3aff"; + ram_color = "c0c0c0"; + engine_color = "eb5454"; + frametime_color = "e8c446"; + text_color = "ffffff"; + background_color = "020202"; + media_player_color = "ffffff"; + + fps_color_change = 1; + fps_color = "39d353,e8c446,eb5454"; + fps_value = "60,30"; + + fps = 1; + fps_only = 0; + + gpu_stats = 1; + gpu_load_change = 1; + gpu_load_value = "60,90"; + gpu_load_color = "39d353,e8c446,eb5454"; + gpu_temp = 1; + gpu_core_clock = 1; + gpu_mem_clock = 0; + gpu_power = 1; + gpu_name = 1; + vram = 1; + + cpu_stats = 1; + cpu_load_change = 1; + cpu_load_value = "60,90"; + cpu_load_color = "39d353,e8c446,eb5454"; + cpu_temp = 1; + cpu_mhz = 1; + core_load = 0; + + ram = 1; + + frametime = 1; + frame_timing = 1; + histogram = 0; + + engine_version = 1; + vulkan_driver = 1; + arch = 0; + + fps_limit = 0; + toggle_hud = "Shift_R+F12"; + toggle_fps_limit = "Shift_L+F1"; + }; + }; + }; +}