steam and gaming refactor
This commit is contained in:
parent
c90f61ad1f
commit
c9cb613280
2 changed files with 50 additions and 54 deletions
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,64 +4,62 @@
|
||||||
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 =
|
||||||
programs = {
|
lib.mkIf config.desktop.enable { programs.steam.enable = true; }
|
||||||
gamescope = gaming-host {
|
// lib.mkIf config.gaming.enable {
|
||||||
|
programs = {
|
||||||
|
gamescope = {
|
||||||
|
enable = true;
|
||||||
|
capSysNice = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
steam = {
|
||||||
|
enable = true;
|
||||||
|
gamescopeSession.enable = true;
|
||||||
|
|
||||||
|
remotePlay.openFirewall = true;
|
||||||
|
dedicatedServer.openFirewall = true;
|
||||||
|
localNetworkGameTransfers.openFirewall = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
gamemode.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.steam-hardware.enable = true;
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
systemPackages = with pkgs; [
|
||||||
|
mangohud
|
||||||
|
protonup-ng
|
||||||
|
protontricks
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.steam = {
|
||||||
enable = true;
|
enable = true;
|
||||||
capSysNice = true;
|
description = "Open Steam in the background at boot";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.steam}/bin/steam -nochatui -nofriendsui -silent %U";
|
||||||
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "5s";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
steam = {
|
# SteamVR kernel patch for AMDGPU
|
||||||
enable = true;
|
# boot.kernelPatches = [
|
||||||
gamescopeSession.enable = gaming-host true;
|
# {
|
||||||
|
# name = "amdgpu-ignore-ctx-privileges";
|
||||||
remotePlay.openFirewall = gaming-host true;
|
# patch = pkgs.fetchpatch {
|
||||||
dedicatedServer.openFirewall = gaming-host true;
|
# name = "cap_sys_nice_begone.patch";
|
||||||
localNetworkGameTransfers.openFirewall = gaming-host true;
|
# url = "https://github.com/Frogging-Family/community-patches/raw/master/linux61-tkg/cap_sys_nice_begone.mypatch";
|
||||||
};
|
# hash = "sha256-Y3a0+x2xvHsfLax/uwycdJf3xLxvVfkfDVqjkxNaYEo=";
|
||||||
|
# };
|
||||||
gamemode.enable = gaming-host true;
|
# }
|
||||||
|
# ];
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.steam-hardware.enable = gaming-host true;
|
|
||||||
|
|
||||||
environment = gaming-host {
|
|
||||||
systemPackages = with pkgs; [
|
|
||||||
mangohud
|
|
||||||
protonup-ng
|
|
||||||
protontricks
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services.steam = gaming-host {
|
|
||||||
enable = true;
|
|
||||||
description = "Open Steam in the background at boot";
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${pkgs.steam}/bin/steam -nochatui -nofriendsui -silent %U";
|
|
||||||
wantedBy = [ "graphical-session.target" ];
|
|
||||||
Restart = "on-failure";
|
|
||||||
RestartSec = "5s";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# SteamVR kernel patch for AMDGPU
|
|
||||||
# boot.kernelPatches = gaming-host [
|
|
||||||
# {
|
|
||||||
# name = "amdgpu-ignore-ctx-privileges";
|
|
||||||
# patch = pkgs.fetchpatch {
|
|
||||||
# name = "cap_sys_nice_begone.patch";
|
|
||||||
# url = "https://github.com/Frogging-Family/community-patches/raw/master/linux61-tkg/cap_sys_nice_begone.mypatch";
|
|
||||||
# hash = "sha256-Y3a0+x2xvHsfLax/uwycdJf3xLxvVfkfDVqjkxNaYEo=";
|
|
||||||
# };
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue