Steam: Difference between revisions

Added section about getting steam game hdr to work within gamescope
Pigs (talk | contribs)
m formatting and hyperlinking
 
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
[https://store.steampowered.com/ Steam] is a digital distribution platform for video games, offering a vast library for purchase, download, and management. On NixOS, Steam is generally easy to install and use, often working "out-of-the-box". It supports running many Windows games on Linux through its compatibility layer, Proton.<ref>https://store.steampowered.com/</ref>
[https://store.steampowered.com/ Steam] is a digital distribution platform for video games, offering a vast library for purchase, download, and management. On NixOS, Steam is generally easy to install and use, often working "out-of-the-box". It supports running many Windows games on Linux through its compatibility layer, [[#Proton|Proton]].<ref>https://store.steampowered.com/</ref>
</translate>
</translate>


Line 17: Line 17:
To temporarily use Steam-related tools like <code>steam-run</code> (for FHS environments) or <code>steamcmd</code> (for server management or tools like steam-tui setup) in a shell environment, you can run:
To temporarily use Steam-related tools like <code>steam-run</code> (for FHS environments) or <code>steamcmd</code> (for server management or tools like steam-tui setup) in a shell environment, you can run:
</translate>
</translate>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="console">
nix-shell -p steam-run # For FHS environment
$ nix-shell -p steam-run # For FHS environment
nix-shell -p steamcmd  # For steamcmd
$ nix-shell -p steamcmd  # For steamcmd
</syntaxhighlight>
</syntaxhighlight>
<translate>
<translate>
<!--T:5-->
<!--T:5-->
This provides the tools in your current shell without adding them to your system configuration. For <code>steamcmd</code> to work correctly for some tasks (like initializing for steam-tui), you might need to run it once to generate necessary files, as shown in the `steam-tui` section.
This provides the tools in your current shell without adding them to your system configuration. For <code>steamcmd</code> to work correctly for some tasks (like initializing for steam-tui), you might need to run it once to generate necessary files, as shown in the [[#steam-tui| steam-tui section]].
</translate>
</translate>


Line 32: Line 32:
<translate>
<translate>
<!--T:7-->
<!--T:7-->
To install the [[Steam]] package and enable all the system options necessary to allow it to run, add the following to your <code>/etc/nixos/configuration.nix</code>:
To install the [[Steam]] package and enable all the system options necessary to allow it to run, add the following to your system configuration:
 
</translate>
</translate>
<syntaxhighlight lang="nix">
{{file|/etc/nixos/configuration.nix|nix|
# Example for /etc/nixos/configuration.nix
<nowiki>
programs.steam = {
programs.steam = {
   enable = true;
   enable = true;
  remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
  dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
};


Line 45: Line 44:
# you might consider using the LTS kernel or a known stable version.
# you might consider using the LTS kernel or a known stable version.
# boot.kernelPackages = pkgs.linuxPackages_lts; # Example for LTS
# boot.kernelPackages = pkgs.linuxPackages_lts; # Example for LTS
</syntaxhighlight>
</nowiki>
}}
 
<translate>
<translate>
<!--T:8-->
<!--T:8-->
Line 51: Line 52:
</translate>
</translate>


{{note|Enabling [[steam]] installs several unfree packages. If you are using <code>allowUnfreePredicate</code> you will need to ensure that your configurations permit all of them.
{{note|Enabling [[steam]] installs several [[unfree software|unfree packages]]. If you are using <code>allowUnfreePredicate</code> you will need to ensure that your configurations permit all of them.
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
{
   nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
   nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
     "steam"
     "steam"
     "steam-unwrapped"
     "steam-unwrapped"
   ];
   ];
}
</syntaxhighlight>
</syntaxhighlight>
}}
}}
Line 68: Line 67:
<translate>
<translate>
<!--T:10-->
<!--T:10-->
Basic Steam features can be enabled directly within the <code>programs.steam</code> attribute set:
Basic Steam features can be enabled directly within the {{nixos:option|programs.steam}} attribute set:
</translate>
</translate>
<syntaxhighlight lang="nix">
{{file|/etc/nixos/configuration.nix|nix|
<nowiki>
programs.steam = {
programs.steam = {
   enable = true; # Master switch, already covered in installation
   enable = true; # Master switch, already covered in installation
   remotePlay.openFirewall = true;  # For Steam Remote Play
   remotePlay.openFirewall = true;  # Open ports in the firewall for Steam Remote Play
   dedicatedServer.openFirewall = true; # For Source Dedicated Server hosting
   dedicatedServer.openFirewall = true; # Open ports for Source Dedicated Server hosting
   # Other general flags if available can be set here.
   # Other general flags if available can be set here.
};
};
# Tip: For improved gaming performance, you can also enable GameMode:
# Tip: For improved gaming performance, you can also enable GameMode:
# programs.gamemode.enable = true;
# programs.gamemode.enable = true;
</syntaxhighlight>
</nowiki>
}}
<translate>
<translate>
<!--T:11-->
<!--T:11-->
If you are using a Steam Controller or a Valve Index, ensure Steam hardware support is enabled. This is typically handled by <code>programs.steam.enable = true;</code> which sets <code>hardware.steam-hardware.enable = true;</code> implicitly. You can verify or explicitly set it if needed:
{{note|If you are using a Steam Controller or a Valve Index, Steam hardware support is implicitly enabled by <code>programs.steam.enable {{=}} true;</code> which sets {{nixos:option|hardware.steam-hardware.enable}} to true.}}
</translate>
</translate>
<syntaxhighlight lang="nix">
hardware.steam-hardware.enable = true;
</syntaxhighlight>
<translate>
<translate>
== Tips and tricks == <!--T:12-->
== Tips and tricks == <!--T:12-->