Merge pull request #312268 from Cryolitia/steam

nixos/steam: add option `extraPackages`, fix CJK fonts on client
This commit is contained in:
K900 2024-05-26 20:52:32 +03:00 committed by GitHub
commit 8de5bd2ac7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -55,6 +55,7 @@ in {
then [ package ] ++ extraPackages
else [ package32 ] ++ extraPackages32;
in prevLibs ++ additionalLibs;
extraPkgs = p: (cfg.extraPackages ++ lib.optionals (prev ? extraPkgs) (prev.extraPkgs p));
} // lib.optionalAttrs (cfg.gamescopeSession.enable && gamescopeCfg.capSysNice)
{
buildFHSEnv = pkgs.buildFHSEnv.override {
@ -71,6 +72,19 @@ in {
'';
};
extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
example = lib.literalExpression ''
with pkgs; [
gamescope
]
'';
description = ''
Additional packages to add to the Steam environment.
'';
};
extraCompatPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
@ -88,6 +102,18 @@ in {
'';
};
fontPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = config.fonts.packages;
defaultText = lib.literalExpression "fonts.packages";
example = lib.literalExpression "with pkgs; [ source-han-sans ]";
description = ''
Font packages to use in Steam.
Defaults to system fonts, but could be overridden to use other fonts useful for users who would like to customize CJK fonts used in Steam. According to the [upstream issue](https://github.com/ValveSoftware/steam-for-linux/issues/10422#issuecomment-1944396010), Steam only follows the per-user fontconfig configuration.
'';
};
remotePlay.openFirewall = lib.mkOption {
type = lib.types.bool;
default = false;
@ -165,6 +191,8 @@ in {
};
};
programs.steam.extraPackages = cfg.fontPackages;
programs.gamescope.enable = lib.mkDefault cfg.gamescopeSession.enable;
services.displayManager.sessionPackages = lib.mkIf cfg.gamescopeSession.enable [ gamescopeSessionFile ];