nix/modules/stuff/gaming.nix
2024-10-16 11:40:24 +02:00

46 lines
1.3 KiB
Nix

{ lib, pkgs, config, ...}: let
inherit (lib) mkIf mkEnableOption mkOption types optionals forEach;
cfg = config.chuj.stuff.gaming;
user = config.chuj.system.user;
in {
options.chuj.stuff.gaming = {
enable = mkEnableOption "gaming";
quake = mkEnableOption "quake";
dosbox = mkEnableOption "dosbox";
ror2 = mkEnableOption "ror2";
steam = mkEnableOption "steam";
scripts = mkOption {
type = types.listOf (types.submodule {
options = {
name = mkOption { type = types.str; };
exe = mkOption { type = types.str; };
};
});
default = [];
};
};
config = mkIf cfg.enable {
programs.steam.enable = cfg.steam;
home-manager.users.${user}.home.packages = with pkgs; ([
wineWowPackages.stable
winetricks
# vvv this shit doesn't build xd
# protontricks
] ++ forEach cfg.scripts (s:
(pkgs.writeShellScriptBin s.name ''
cd ~/games/${s.name}
wine ${s.exe}
'')
)
++ optionals cfg.dosbox [ dosbox-staging ]
++ optionals cfg.ror2 [ r2modman ]
++ optionals cfg.quake [ vkquake ericw-tools-latest trenchbroom fteqcc gmqcc ]);
# Trenchbroom
nixpkgs.config.permittedInsecurePackages = optionals cfg.quake [
"freeimage-unstable-2021-11-01"
];
};
}