dotfiles/etcnixos/steam.nix

51 lines
1.2 KiB
Nix

{
pkgs,
config,
lib,
...
}:
{
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"steam"
"steam-original"
"steam-unwrapped"
"steam-run"
];
programs.steam = {
enable = true;
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
environment.systemPackages = with pkgs; [
steamtinkerlaunch
mangohud
goverlay
yad
];
# Create steam session script
environment.etc."steam-session-greetd".source = pkgs.writeShellScript "steam-session-greetd" ''
export STEAM_RUNTIME=1
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export GDK_BACKEND=wayland
export XDG_CURRENT_DESKTOP=Steam
export XDG_SESSION_TYPE=wayland
exec ${pkgs.gamescope}/bin/gamescope --adaptive-sync --hdr-enabled --rt --steam -- ${pkgs.steam}/bin/steam -pipewire-dmabuf -tenfoot
'';
# Create system-wide session files
environment.etc."xdg/wayland-sessions/steam-session.desktop".text = ''
[Desktop Entry]
Name=Steam Session
Comment=Steam Deck-like gaming session with gamescope
Exec=/etc/steam-session-greetd
Type=Application
DesktopNames=steam
'';
}