Files
nixos-config/modules/nixos/steam/default.nix

100 lines
3.4 KiB
Nix

{
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
# as well as the libraries available from your flake's inputs.
lib,
# An instance of `pkgs` with your overlays and packages applied is also available.
pkgs,
# You also have access to your flake's inputs.
inputs,
# Additional metadata is provided by Snowfall Lib.
# The namespace used for your flake, defaulting to "internal" if not set.
namespace,
# The system architecture for this host (eg. `x86_64-linux`).
system,
# The Snowfall Lib target for this system (eg. `x86_64-iso`).
target,
# A normalized name for the system target (eg. `iso`).
format,
# A boolean to determine whether this system is a virtual target using nixos-generators.
virtual,
# An attribute map of your defined hosts.
systems,
# All other arguments come from the system system.
config
, ...
}:{
config = {
# programs.gamescope = {
# enable = true;
# capSysNice = true;
# };
environment.systemPackages = with pkgs; [
protonup-ng # Tool to install and manage Proton-GE
lutris
vkd3d
dxvk
corefonts
protontricks
mangohud
vkbasalt
gamescope
];
programs.steam = {
enable = true;
package = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [
gamemode
];
extraEnv = {
SDL_VIDEODRIVER = "wayland";
SDL_GAMECONTROLLERCONFIG = "$(cat <<-END
060000000d0f00009601000000000000,Steam Controller (HHD),a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,paddle1:b13,paddle2:b12,paddle3:b15,paddle4:b14,misc2:b11,misc3:b16,misc4:b17,crc:ea35,
0300a81c5e040000a102000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,crc:1ca8,
$SDL_GAMECONTROLLERCONFIG
END
)"
};
};
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
# gamescopeSession = {
# enable = true;
# env = {
# WLR_RENDERER = "vulkan";
# DXVK_HDR = "0 ";
# ENABLE_GAMESCOPE_WSI = "0";
# WINE_FULLSCREEN_FSR = "1";
# # Games allegedly prefer X11
# SDL_VIDEODRIVER = "x11";
# };
# args = [
# "--xwayland-count 1"
# "--expose-wayland"
# "-e" # Enable steam integration
# "--steam"
# # "--adaptive-sync"
# # "--hdr-enabled"
# # "--hdr-itm-enable"
# # External monitor
# "--prefer-output DP-3"
# "--output-width 1920"
# "--output-height 1080"
# "-r 172"
# # Laptop display
# # "--prefer-output eDP-1"
# # "--output-width 2560"
# # "--output-height 1600"
# # "-r 120"
# # "--prefer-vk-device 10de:1b81" # lspci -nn | grep VGA
# ];
# };
};
};
}