dotfiles/nixos/modules/gaming.nix
main a5a651dbb9
Large rework and cleanup
Signed-off-by: main <magic_rb@redalder.org>
2022-07-31 11:03:59 +02:00

41 lines
801 B
Nix

{
config,
pkgs,
lib,
options,
...
}:
with lib; let
cfg = config.magic_rb.gaming;
in {
options.magic_rb.gaming = {
enable = mkEnableOption "Enable Gaming support.";
steam.remotePlay = mkOption {
description = ''
Open ports required for remote play;
'';
type = types.bool;
default = false;
};
};
config = mkMerge [
(optionalAttrs (options ? "home-manager")
{
home-manager.users."main" = mkIf cfg.enable ({...}: {
magic_rb = {
packageCollections.wine.enable = true;
programs.multimc.enable = true;
};
});
})
(mkIf cfg.enable {
programs.steam = {
enable = cfg.enable;
remotePlay.openFirewall = cfg.steam.remotePlay;
};
})
];
}