diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 136f01a..2a293e1 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -41,6 +41,7 @@ aseprite cloc viu + qbittorrent ]; chuj = { @@ -116,6 +117,7 @@ enable = true; keys = { "git@github.com".file = "github"; + "git@codeberg.org".file = "codeberg"; "forgejo@git.jacekpoz.pl".file = "jacekgit"; "krizej@192.168.1.12".file = "rpi"; "discord@zasadzka.pl" = { @@ -134,10 +136,13 @@ gaming = { enable = true; quake = true; - homm3 = true; dosbox = true; ror2 = true; steam = true; + scripts = [ + { name = "homm3"; exe = "HD_Launcher.exe"; } + { name = "gtasa"; exe = "gta_sa.exe"; } + ]; }; }; }; diff --git a/modules/stuff/gaming.nix b/modules/stuff/gaming.nix index 444f0ae..b108cf3 100644 --- a/modules/stuff/gaming.nix +++ b/modules/stuff/gaming.nix @@ -1,15 +1,22 @@ { lib, pkgs, config, ...}: let - inherit (lib) mkIf mkEnableOption mkOption types optionals; + 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"; - homm3 = mkEnableOption "homm3"; 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; }; + }; + }); + }; }; config = mkIf cfg.enable { @@ -18,21 +25,20 @@ in { home-manager.users.${user}.home.packages = with pkgs; ([ wineWowPackages.stable winetricks - ] + 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 ] - ++ optionals cfg.homm3 [ - # todo download it from rpi maybe or something - (pkgs.writeShellScriptBin "homm3" '' - cd ~/games/homm3 - wine HD_Launcher.exe - '') - ]); + ++ optionals cfg.quake [ vkquake ericw-tools-latest trenchbroom fteqcc gmqcc ]); # Trenchbroom nixpkgs.config.permittedInsecurePackages = optionals cfg.quake [ "freeimage-unstable-2021-11-01" ]; }; -} \ No newline at end of file +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 757e747..3816686 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -19,5 +19,12 @@ make -j6 DO_USERDIRS=1 prefix=$out bindir=$out/bin ''; }); + protontricks = prevPkgs.protontricks.overrideAttrs (prev: { + src = pkgs.fetchFromGitHub { + inherit (prev.src) owner repo; + rev = "f7b1fa33b0438dbd72f7222703f8442e40edc510"; + sha256 = "sha256-t794WEMJx/JNX3gTMHfgquFWB7yXkleW07+QURm1NPM="; + }; + }); }) ]