Merge pull request #196773 from bobvanderlinden/pr-steam-package

This commit is contained in:
Maciej Krüger 2022-11-18 13:08:39 +01:00 committed by GitHub
commit 980e2c2ed2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,17 +4,31 @@ with lib;
let let
cfg = config.programs.steam; cfg = config.programs.steam;
steam = pkgs.steam.override {
extraLibraries = pkgs: with config.hardware.opengl;
if pkgs.hostPlatform.is64bit
then [ package ] ++ extraPackages
else [ package32 ] ++ extraPackages32;
};
in { in {
options.programs.steam = { options.programs.steam = {
enable = mkEnableOption (lib.mdDoc "steam"); enable = mkEnableOption (lib.mdDoc "steam");
package = mkOption {
type = types.package;
default = pkgs.steam.override {
extraLibraries = pkgs: with config.hardware.opengl;
if pkgs.hostPlatform.is64bit
then [ package ] ++ extraPackages
else [ package32 ] ++ extraPackages32;
};
defaultText = literalExpression ''
pkgs.steam.override {
extraLibraries = pkgs: with config.hardware.opengl;
if pkgs.hostPlatform.is64bit
then [ package ] ++ extraPackages
else [ package32 ] ++ extraPackages32;
}
'';
description = lib.mdDoc ''
steam package to use.
'';
};
remotePlay.openFirewall = mkOption { remotePlay.openFirewall = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
@ -44,7 +58,10 @@ in {
hardware.steam-hardware.enable = true; hardware.steam-hardware.enable = true;
environment.systemPackages = [ steam steam.run ]; environment.systemPackages = [
cfg.package
cfg.package.run
];
networking.firewall = lib.mkMerge [ networking.firewall = lib.mkMerge [
(mkIf cfg.remotePlay.openFirewall { (mkIf cfg.remotePlay.openFirewall {