92 lines
1.9 KiB
Nix
Executable File
92 lines
1.9 KiB
Nix
Executable File
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
namespace,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.${namespace}.gaming;
|
|
in
|
|
{
|
|
imports = [ ./options.nix ];
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
# Network option required using sysctl to let Ubisoft Connect work as of 7-12-2023
|
|
boot.kernel.sysctl."net.ipv4.tcp_mtu_probing" = 1;
|
|
|
|
# Configure programs
|
|
programs.steam = {
|
|
enable = true;
|
|
package = pkgs.steam.override {
|
|
extraPkgs =
|
|
_pkgs: with pkgs; [
|
|
xorg.libXcursor
|
|
xorg.libXi
|
|
xorg.libXinerama
|
|
xorg.libXScrnSaver
|
|
libpng
|
|
libpulseaudio
|
|
libvorbis
|
|
stdenv.cc.cc.lib
|
|
libkrb5
|
|
keyutils
|
|
];
|
|
};
|
|
# Open ports in the firewall for Steam Remote Play
|
|
remotePlay.openFirewall = true;
|
|
# Open ports in the firewall for Source Dedicated Server
|
|
dedicatedServer.openFirewall = true;
|
|
extraCompatPackages = with pkgs; [
|
|
proton-ge-bin
|
|
] ++ (with pkgs.${namespace}; [
|
|
proton-cachyos
|
|
proton-cachyos-v3
|
|
proton-cachyos-v2
|
|
proton-cachyos-v1
|
|
]);
|
|
gamescopeSession = {
|
|
enable = true;
|
|
args = [
|
|
"-f"
|
|
"-H 2160"
|
|
"-W 3840"
|
|
"-r 240"
|
|
"--hdr-enabled"
|
|
"--adaptive-sync"
|
|
];
|
|
};
|
|
}; # "gamescope -f -H 2160 -W 3840 -r 240 --adaptive-sync --hdr-enabled
|
|
|
|
programs = {
|
|
alvr = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
package = pkgs.alvr;
|
|
};
|
|
|
|
gamescope = {
|
|
enable = true;
|
|
capSysNice = true;
|
|
};
|
|
|
|
gamemode.enable = true;
|
|
};
|
|
|
|
# Hardware configs
|
|
hardware = {
|
|
# Xbox controllers
|
|
xpadneo.enable = false;
|
|
|
|
# Steam udev rules for remote play
|
|
steam-hardware.enable = true;
|
|
};
|
|
|
|
environment = {
|
|
variables = {
|
|
STEAM_FORCE_DESKTOPUI_SCALING = "1.0";
|
|
};
|
|
};
|
|
};
|
|
}
|