diff --git a/etcnixos/common.nix b/etcnixos/common.nix index c4e74e2..e8a3af5 100644 --- a/etcnixos/common.nix +++ b/etcnixos/common.nix @@ -49,13 +49,44 @@ enable = true; settings = { default_session = { - command = "${lib.getExe pkgs.tuigreet} --sessions --time"; + command = "${lib.getExe pkgs.tuigreet} --sessions /etc/xdg/wayland-sessions/ --time"; user = username; }; terminal.vt = lib.mkForce 2; }; }; + # 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 + export MANGOHUD=1 + exec ${pkgs.gamescope}/bin/gamescope --adaptive-sync --hdr-enabled --mangoapp --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 + ''; + + environment.etc."xdg/wayland-sessions/niri-session.desktop".text = '' + [Desktop Entry] + Name=Niri Session + Comment=Niri Wayland compositor + Exec=${pkgs.niri}/bin/niri-session + Type=Application + DesktopNames=niri + ''; + system.activationScripts = { # FIX: https://github.com/NixOS/nix/issues/2982 "profile-channel-dummy".text = '' diff --git a/etcnixos/steam.nix b/etcnixos/steam.nix index 94fd12f..2a893c9 100644 --- a/etcnixos/steam.nix +++ b/etcnixos/steam.nix @@ -21,5 +21,8 @@ environment.systemPackages = with pkgs; [ steamtinkerlaunch + mangohud + goverlay + yad ]; } diff --git a/home-manager/home-yarn.nix b/home-manager/home-yarn.nix index d47f01d..07c1660 100644 --- a/home-manager/home-yarn.nix +++ b/home-manager/home-yarn.nix @@ -71,26 +71,6 @@ '') ]; - # Create desktop entry for Steam session - xdg.dataFile."wayland-sessions/steam-session.desktop".text = '' - [Desktop Entry] - Name=Steam Session - Comment=Steam Deck-like gaming session with gamescope - Exec=${config.home.homeDirectory}/.nix-profile/bin/steam-session-greetd - Type=Application - DesktopNames=steam - ''; - - # Create desktop entry for Niri session - xdg.dataFile."wayland-sessions/niri-session.desktop".text = '' - [Desktop Entry] - Name=Niri Session - Comment=Niri Wayland compositor - Exec=${config.programs.niri.package}/bin/niri-session - Type=Application - DesktopNames=niri - ''; - programs.obs-studio = { enable = true; plugins = with pkgs.obs-studio-plugins; [