nix/lib/modules/nixos/gaming.nix

73 lines
1.5 KiB
Nix
Raw Normal View History

2025-02-16 10:43:53 -06:00
{
lib,
config,
2025-02-16 11:17:59 -06:00
options,
pkgs,
...
}:
{
config = lib.mkIf config.programs.steam.enable {
programs.gamescope.enable = true;
2025-02-16 11:17:59 -06:00
services.pipewire = {
alsa.support32Bit = true;
};
2025-02-16 11:17:59 -06:00
programs.steam = {
extest.enable = true;
gamescopeSession.enable = true;
2025-02-16 11:17:59 -06:00
extraPackages = with pkgs; [
gamescope
];
2025-02-16 11:17:59 -06:00
extraCompatPackages = with pkgs; [
proton-ge-bin
];
2025-02-16 11:17:59 -06:00
localNetworkGameTransfers.openFirewall = true;
remotePlay.openFirewall = true;
2025-02-16 11:17:59 -06:00
};
hardware =
(
if builtins.hasAttr "graphics" options.hardware then
{
graphics = {
enable = true;
enable32Bit = true;
};
}
else
{
opengl = {
enable = true;
driSupport32Bit = true;
};
}
)
// {
steam-hardware.enable = true;
};
2025-02-16 10:43:53 -06:00
services.udev.packages = with pkgs; [ steam ];
2025-02-16 11:17:59 -06:00
environment = {
systemPackages = with pkgs; [
dualsensectl # for interfacing with dualsense controllers programmatically
wineWowPackages.waylandFull
lutris
winetricks
ludusavi
# ludusavi uses rclone
rclone
];
};
# remote play ports - should be unnecessary due to programs.steam.remotePlay.openFirewall = true;
/*
networking.firewall.allowedUDPPortRanges = [ { from = 27031; to = 27036; } ];
networking.firewall.allowedTCPPortRanges = [ { from = 27036; to = 27037; } ];
*/
};
2025-02-16 10:43:53 -06:00
}