{
config,
lib,
...
}: let
cfg = config.roles.gaming;
in {
config = lib.mkIf cfg.steam.enable {
arta.unfree.allow = [
"steam-run"
"steam-original"
"steam"
];
nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
extraPkgs = pkgs:
with pkgs; [
# For gamescope to work properly:
# https://github.com/NixOS/nixpkgs/issues/162562#issuecomment-1523177264
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
# Fallback fonts (e.g. for Don't Get Lost).
liberation_ttf
];
};
};
programs.steam = {
enable = true;
remotePlay.openFirewall = false;
dedicatedServer.openFirewall = false;
};
hardware.steam-hardware.enable = true;
};
}