steam and gaming refactor

This commit is contained in:
Lilith 2026-01-15 14:33:49 +01:00
parent c90f61ad1f
commit c9cb613280
No known key found for this signature in database
GPG key ID: 272C807BD91F8446
2 changed files with 50 additions and 54 deletions

View file

@ -9,8 +9,6 @@ in
desktop.enable = true; desktop.enable = true;
home-manager.users."lilith".desktop.touchSupport = true; home-manager.users."lilith".desktop.touchSupport = true;
gaming.enable = true;
gaming.client-only = true;
nfs.client.enable = true; nfs.client.enable = true;
auto_styling.enable = true; auto_styling.enable = true;

View file

@ -4,36 +4,34 @@
lib, lib,
... ...
}: }:
let
gaming-host = lib.mkIf (!config.gaming.client-only);
in
{ {
options.gaming.enable = lib.mkEnableOption "Enable steam and related software"; options.gaming.enable = lib.mkEnableOption "Enable steam and related software";
options.gaming.client-only = lib.mkEnableOption "Only enable steam, to stream via SteamLink";
config = lib.mkIf config.gaming.enable { config =
lib.mkIf config.desktop.enable { programs.steam.enable = true; }
// lib.mkIf config.gaming.enable {
programs = { programs = {
gamescope = gaming-host { gamescope = {
enable = true; enable = true;
capSysNice = true; capSysNice = true;
}; };
steam = { steam = {
enable = true; enable = true;
gamescopeSession.enable = gaming-host true; gamescopeSession.enable = true;
remotePlay.openFirewall = gaming-host true; remotePlay.openFirewall = true;
dedicatedServer.openFirewall = gaming-host true; dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = gaming-host true; localNetworkGameTransfers.openFirewall = true;
}; };
gamemode.enable = gaming-host true; gamemode.enable = true;
}; };
hardware.steam-hardware.enable = gaming-host true; hardware.steam-hardware.enable = true;
environment = gaming-host { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
mangohud mangohud
protonup-ng protonup-ng
@ -41,7 +39,7 @@ in
]; ];
}; };
systemd.user.services.steam = gaming-host { systemd.user.services.steam = {
enable = true; enable = true;
description = "Open Steam in the background at boot"; description = "Open Steam in the background at boot";
serviceConfig = { serviceConfig = {
@ -53,7 +51,7 @@ in
}; };
# SteamVR kernel patch for AMDGPU # SteamVR kernel patch for AMDGPU
# boot.kernelPatches = gaming-host [ # boot.kernelPatches = [
# { # {
# name = "amdgpu-ignore-ctx-privileges"; # name = "amdgpu-ignore-ctx-privileges";
# patch = pkgs.fetchpatch { # patch = pkgs.fetchpatch {