2022-05-22 19:43:46 -04:00
{ config , pkgs , lib , . . . }: {
2022-04-25 21:54:53 -04:00
2022-12-21 14:18:03 -07:00
options . gaming . steam . enable = lib . mkEnableOption " S t e a m g a m e l a u n c h e r . " ;
2022-04-25 21:54:53 -04:00
2022-12-21 14:18:03 -07:00
config = lib . mkIf ( config . gaming . steam . enable && pkgs . stdenv . isLinux ) {
2022-04-25 21:54:53 -04:00
hardware . steam-hardware . enable = true ;
2022-10-29 14:42:37 -04:00
unfreePackages = [ " s t e a m " " s t e a m - o r i g i n a l " " s t e a m c m d " " s t e a m - r u n " ] ;
2022-05-28 10:34:00 -04:00
2023-03-05 23:03:34 -05:00
programs . steam = {
enable = true ;
remotePlay . openFirewall = true ;
} ;
environment . systemPackages = with pkgs ; [
2022-05-28 10:34:00 -04:00
# Enable terminal interaction
steamPackages . steamcmd
steam-tui
2023-06-05 23:50:17 -04:00
# Allow downloading of GE-Proton and other versions
protonup-qt
2022-05-28 10:34:00 -04:00
] ;
2023-03-05 23:03:34 -05:00
2023-09-16 11:15:41 -04:00
# Adapted in part from: https://github.com/Shawn8901/nix-configuration/blob/1c48be94238a9f463cf0bbd1e1842a4454286514/modules/nixos/steam-compat-tools/default.nix
# Based on: https://github.com/NixOS/nixpkgs/issues/73323
environment . sessionVariables . STEAM_EXTRA_COMPAT_TOOLS_PATHS =
lib . makeBinPath [ pkgs . proton-ge-custom ] ;
2023-08-08 22:13:24 -04:00
# Seems like NetworkManager can help speed up Steam launch
# https://www.reddit.com/r/archlinux/comments/qguhco/steam_startup_time_arch_1451_seconds_fedora_34/hi8opet/
networking . networkmanager . enable = true ;
2022-04-25 21:54:53 -04:00
} ;
}