Skip to content

Commit 61d5f36

Browse files
feat(steam): Proton-GE PRIME Steam on sliceanddice
Pin xwayland-satellite 0.8.3 so Steam's X11 menus stay open under niri.
1 parent 8ab48dd commit 61d5f36

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

‎hosts/nixos/sliceanddice/default.nix‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@
139139
dendritic.apps.linux-desktop.enable = true;
140140
# Heroic + Proton-GE DLSS/NVAPI + PRIME offload (RTX 3050 Ti Laptop).
141141
dendritic.apps.heroic.enable = true;
142+
# Steam + the same Proton-GE / PRIME path. No gamescope session (niri).
143+
dendritic.apps.steam.enable = true;
142144

143145
# Quiet-first power: RAPL/EPP feedback controller, zswap, lid/idle suspend.
144146
# Owns CPU power policy — do not enable TLP / auto-cpufreq / PPD alongside.

‎modules/apps/steam.nix‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Steam — Proton-GE + NVIDIA PRIME offload on hybrid laptops.
2+
#
3+
# sliceanddice: Intel panel, RTX 3050 Ti via PRIME. The Steam client and its
4+
# Proton children must offload or NVAPI/DLSS never see the dGPU. Do not enable
5+
# a gamescope session: nested gamescope-wl ABRTs niri (see heroic.nix).
6+
{
7+
flake.modules.nixos.dendritic =
8+
{
9+
lib,
10+
pkgs,
11+
config,
12+
...
13+
}:
14+
let
15+
cfg = config.dendritic.apps.steam;
16+
nvidia = config.hardware.nvidia.modesetting.enable or false;
17+
offload = config.hardware.nvidia.prime.offload.enable or false;
18+
# Same NVAPI/DLSS keys Heroic merges for Proton-GE. PRIME vars match
19+
# nvidia-offload so the client and games inherit the dGPU.
20+
extraEnv =
21+
lib.optionalAttrs nvidia {
22+
PROTON_ENABLE_NVAPI = "1";
23+
PROTON_HIDE_NVIDIA_GPU = "0";
24+
DXVK_ENABLE_NVAPI = "1";
25+
PROTON_DLSS_UPGRADE = "1";
26+
}
27+
// lib.optionalAttrs offload {
28+
__NV_PRIME_RENDER_OFFLOAD = "1";
29+
__NV_PRIME_RENDER_OFFLOAD_PROVIDER = "NVIDIA-G0";
30+
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
31+
__VK_LAYER_NV_optimus = "NVIDIA_only";
32+
};
33+
in
34+
{
35+
options.dendritic.apps.steam = {
36+
enable = lib.mkEnableOption ''
37+
Steam, with Proton-GE and NVIDIA PRIME/NVAPI when that GPU is configured.
38+
'';
39+
};
40+
41+
config = lib.mkIf cfg.enable {
42+
programs.steam = {
43+
enable = true;
44+
# Wayland (niri): Steam Input needs X11 events translated to uinput.
45+
extest.enable = config.dendritic.apps.niri.enable or false;
46+
remotePlay.openFirewall = true;
47+
localNetworkGameTransfers.openFirewall = true;
48+
extraCompatPackages = [ pkgs.proton-ge-bin ];
49+
extraPackages = lib.optionals config.programs.gamemode.enable [ pkgs.gamemode ];
50+
package = pkgs.steam.override { inherit extraEnv; };
51+
};
52+
};
53+
};
54+
}

‎modules/overlays.nix‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,28 @@
8989
'';
9090
});
9191

92+
# 0.8.2 focuses X11 override-redirect popups, so Steam's top-bar menus
93+
# (View/Friends/Games/Help) unmap the instant they open under niri.
94+
# 0.8.3 (add2795) fixes it. Drop once the pinned nixpkgs ships ≥ 0.8.3.
95+
xwayland-satellite =
96+
if prev.lib.versionOlder prev.xwayland-satellite.version "0.8.3" then
97+
prev.xwayland-satellite.overrideAttrs (old: rec {
98+
version = "0.8.3";
99+
src = prev.fetchFromGitHub {
100+
owner = "Supreeeme";
101+
repo = "xwayland-satellite";
102+
tag = "v${version}";
103+
hash = "sha256-eFEjCCniMCKeWU0PcZNv+tDYe08SLFPjRplyPY8OFt4=";
104+
};
105+
cargoDeps = final.rustPlatform.fetchCargoVendor {
106+
inherit (old) pname;
107+
inherit version src;
108+
hash = "sha256-gMGFvnbxM3hD5fmkSimaFd87GEf6BXFe/MGjoS6VNVU=";
109+
};
110+
})
111+
else
112+
prev.xwayland-satellite;
113+
92114
jetbrains =
93115
prev.jetbrains
94116
// prev.lib.optionalAttrs prev.stdenv.isDarwin {

0 commit comments

Comments
 (0)