nix/modules/stuff/gaming.nix

39 lines
No EOL
1.1 KiB
Nix

{ lib, pkgs, config, ...}: let
inherit (lib) mkIf mkEnableOption mkOption types optionals;
cfg = config.chuj.stuff.gaming;
user = config.chuj.system.user;
in {
options.chuj.stuff.gaming = let
gameOption = mkOption { type = types.bool; default = true; };
in {
enable = mkEnableOption "gaming";
quake = gameOption;
homm3 = gameOption;
dosbox = gameOption;
ror2 = gameOption;
};
config = mkIf cfg.enable {
programs.steam.enable = true;
home-manager.users.${user}.home.packages = with pkgs; ([
wineWowPackages.stable
winetricks
]
++ optionals cfg.dosbox [ dosbox-staging ]
++ optionals cfg.ror2 [ r2modman ]
++ optionals cfg.quake [ vkquake ericw-tools-latest trenchbroom fteqcc gmqcc ]
++ optionals cfg.homm3 [
# todo download it from rpi maybe or something
(pkgs.writeShellScriptBin "homm3" ''
cd ~/games/homm3
wine HD_Launcher.exe
'')
]);
# Trenchbroom
nixpkgs.config.permittedInsecurePackages = optionals cfg.quake [
"freeimage-unstable-2021-11-01"
];
};
}