diff --git a/hosts/goopnet-interface/default.nix b/hosts/goopnet-interface/default.nix index 78dacff..3348282 100755 --- a/hosts/goopnet-interface/default.nix +++ b/hosts/goopnet-interface/default.nix @@ -90,6 +90,7 @@ distractions.discord.enable = true; distractions.discord.vesktop = true; distractions.steam.enable = true; + distractions.steam.useGamescope = true; # tools tools.gpg.enable = true; tools.rbw.enable = true; diff --git a/modules/software/distractions/steam.nix b/modules/software/distractions/steam.nix index ac48cbd..3ffd1ef 100644 --- a/modules/software/distractions/steam.nix +++ b/modules/software/distractions/steam.nix @@ -6,10 +6,41 @@ let in { options.modules.software.distractions.steam = { enable = mkEnableOption "Enable Steam, the game distribution software"; + useGamescope = mkEnableOption "Enable Gamescope, a tool to run games in a separate X session"; }; config = mkIf cfg.enable { - programs.steam.enable = true; - programs.steam.protontricks.enable = true; + programs.steam = { + enable = true; + package = pkgs.steam.override { + # required for programs to run sometimes + # see: https://github.com/NixOS/nixpkgs/issues/162562#issuecomment-1229444338 + extraPkgs = (pkgs: (lib.optional cfg.useGamescope pkgs.gamescope) ++ (with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + keyutils + ])); + }; + extraCompatPackages = with pkgs; [ proton-ge-bin ]; + protontricks.enable = true; + + localNetworkGameTransfers.openFirewall = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + }; + + programs.gamescope = { + enable = true; + # capSysNice = true; https://github.com/NixOS/nixpkgs/issues/351516 + }; + + user.packages = with pkgs; [ steam-run ]; }; }