nixos/steam: add package option

This commit is contained in:
Bob van der Linden 2022-10-19 17:05:13 +02:00
parent 32096899af
commit e8856a00da
No known key found for this signature in database
GPG Key ID: EEBE8E3EC4A31364

View File

@ -4,17 +4,31 @@ with lib;
let
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 {
options.programs.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 {
type = types.bool;
default = false;
@ -44,7 +58,10 @@ in {
hardware.steam-hardware.enable = true;
environment.systemPackages = [ steam steam.run ];
environment.systemPackages = [
cfg.package
cfg.package.run
];
networking.firewall = lib.mkMerge [
(mkIf cfg.remotePlay.openFirewall {