config.nix/modules/apps/gaming/default.nix
2026-04-28 12:44:10 +02:00

92 lines
2.2 KiB
Nix

{
config,
lib,
pkgs,
...
}:
{
options = {
apps.gaming = {
enable = lib.mkEnableOption "enable gaming";
steam.enable = lib.mkEnableOption "enable steam";
minecraft.enable = lib.mkEnableOption "enable minecraft";
};
};
config = {
environment.systemPackages =
with pkgs;
[ ]
++ (
if (config.apps.gaming.enable) then
[
cartridges
(pkgs.lutris.override {
# Intercept buildFHSEnv to modify target packages
buildFHSEnv =
args:
pkgs.buildFHSEnv (
args
// {
multiPkgs =
envPkgs:
let
# Fetch original package list
originalPkgs = args.multiPkgs envPkgs;
# Disable tests for openldap
customLdap = envPkgs.openldap.overrideAttrs (_: {
doCheck = false;
});
in
# Replace broken openldap with the custom one
builtins.filter (p: (p.pname or "") != "openldap") originalPkgs ++ [ customLdap ];
}
);
})
]
else
[ ]
)
++ (
if (config.apps.gaming.minecraft.enable) then
[ prismlauncher ]
else
[ ]
)
++ (
if (config.apps.gaming.steam.enable) then
[ adwsteamgtk ]
else
[ ]
);
programs = {
steam =
if config.apps.gaming.steam.enable then
{
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
gamescopeSession.enable = true;
protontricks.enable = true;
extraCompatPackages = with pkgs; [
proton-ge-bin
];
extraPackages = with pkgs; [
gamescope
];
}
else
{ };
gamescope = {
enable = true;
capSysNice = true;
};
};
};
}