added mangohud

This commit is contained in:
kenji
2025-06-30 14:37:42 -05:00
parent d2baeeba6d
commit ed24c8eaea
5 changed files with 20 additions and 82 deletions
+12 -8
View File
@@ -3,12 +3,16 @@
myConfig,
...
}: {
imports = [
../packages/hyprland/default.nix
../packages/hypridle/default.nix
../packages/hyprlock/default.nix
../packages/rofi/default.nix
../packages/matugen/default.nix
../packages/swww/default.nix
];
imports =
[
../packages/hyprland/default.nix
../packages/hypridle/default.nix
../packages/hyprlock/default.nix
../packages/rofi/default.nix
../packages/matugen/default.nix
../packages/swww/default.nix
]
++ lib.optionals (myConfig.linux.gaming == true) [
../packages/mangohud/default.nix
];
}
-72
View File
@@ -1,72 +0,0 @@
# In your ~/.config/home-manager/home.nix (or a file imported by it)
{
config,
pkgs,
...
}:
# Home Manager modules usually get config and pkgs as arguments
let
# Define the custom Steam launcher script within Home Manager's scope.
# pkgs here refers to the pkgs available to your Home Manager environment.
steamGamescopeWrapper = pkgs.writeScriptBin "steam-gamescope-launcher" ''
#!/usr/bin/env bash
set -xeuo pipefail
gamescopeArgs=(
--adaptive-sync
--hdr-enabled
--mangoapp
--rt
--steam
)
steamArgs=(
-pipewire-dmabuf
-tenfoot
)
mangoConfig=(
cpu_temp
gpu_temp
ram
vram
)
mangoVars=(
MANGOHUD=1
MANGOHUD_CONFIG="$(IFS=,; echo "$${mangoConfig[*]}")"
)
export PATH="${pkgs.gamescope}/bin:${pkgs.mangohud}/bin:$PATH"
export "$${mangoVars[@]}"
exec ${pkgs.gamescope}/bin/gamescope "$${gamescopeArgs[@]}" -- ${pkgs.steam}/bin/steam "$${steamArgs[@]}"
'';
in {
# You don't need 'programs.xdg.enable = true;' explicitly here in Home Manager;
# xdg.desktopEntries will be available directly once Home Manager is active.
# Home Manager usually manages user-level packages under `home.packages`.
home.packages = with pkgs; [
protonup-qt
mangohud
goverlay
steamGamescopeWrapper # Add your wrapper script to your user's PATH
];
# Define the desktop entry within Home Manager's xdg.desktopEntries
xdg.desktopEntries.steam = {
name = "Steam (Gamescope)";
comment = "Launch Steam via Gamescope with MangoHud";
exec = "${steamGamescopeWrapper}";
icon = "steam";
terminal = false;
type = "Application";
categories = ["Game" "Application"];
startupNotify = true;
};
# If you previously had services.getty.autologinUser, that remains in configuration.nix.
# Likewise for hardware.xone.enable and boot.kernelPackages.
# Note: programs.steam.enable, programs.gamescope.enable, hardware.xone.enable
# usually remain in configuration.nix (system-wide), as they install the programs
# and drivers for the whole system.
}