.hive/modules/programs/games.nix

62 lines
1.2 KiB
Nix

{
config,
lib,
pkgs,
...
}: let
cfg = config.hive.programs.games;
in {
options.hive.programs.games = {
enable = lib.mkEnableOption "Enable the games module";
steam = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enable Steam support.
'';
};
lutris = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enable Lutris support.
'';
};
r2modman = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enable R2ModMan support.
'';
};
wine = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enable Wine support.
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages =
lib.optional cfg.lutris
(pkgs.lutris.override {
extraPkgs = pkgs: [
pkgs.libnghttp2
pkgs.winetricks
];
})
++ lib.optional cfg.r2modman pkgs.r2modman
++ lib.optionals cfg.wine [
pkgs.wine
pkgs.winetricks
];
programs.steam = lib.mkIf cfg.steam {
enable = true;
gamescopeSession.enable = true;
};
};
}