diff --git a/modules/apps/gaming/default.nix b/modules/apps/gaming/default.nix index 214d4cd..7112106 100644 --- a/modules/apps/gaming/default.nix +++ b/modules/apps/gaming/default.nix @@ -6,8 +6,41 @@ }: { - imports = [ - ./steam.nix - ./minecraft.nix - ]; + options = { + apps.gaming = { + enable = true; + steam.enable = lib.mkEnableOption "enable steam"; + minecraft.enable = lib.mkEnableOption "enable minecraft"; + }; + }; + + config = { + environment.systemPackages = with pkgs; [ + (lib.mkIf (config.apps.gaming.enable) cartridges) + (lib.mkIf (config.apps.gaming.enable) lutris) + (lib.mkIf (config.apps.gaming.minecraft.enable) prismlauncher) + (lib.mkIf (config.apps.gaming.steam.enable) adwsteamgtk) + ]; + programs = { + steam = lib.mkIf config.apps.gaming.steam.enable { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = true; + protontricks.enable = true; + extraCompatPackages = with pkgs; [ + proton-ge-bin + ]; + extraPackages = with pkgs; [ + gamescope + ]; + }; + gamescope = { + enable = true; + capSysNice = true; + }; + }; + }; + } diff --git a/modules/apps/gaming/minecraft.nix b/modules/apps/gaming/minecraft.nix deleted file mode 100644 index 60bae60..0000000 --- a/modules/apps/gaming/minecraft.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -{ - options = { - apps.gaming = { - minecraft.enable = lib.mkEnableOption "enable minecraft"; - }; - }; - - config = lib.mkIf config.apps.gaming.minecraft.enable { - environment.systemPackages = with pkgs; [ - prismlauncher - ]; - }; -} diff --git a/modules/apps/gaming/steam.nix b/modules/apps/gaming/steam.nix deleted file mode 100644 index 2da6f0d..0000000 --- a/modules/apps/gaming/steam.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -{ - options = { - apps.gaming = { - steam.enable = lib.mkEnableOption "enable steam"; - }; - }; - - config = lib.mkIf config.apps.gaming.steam.enable { - environment.systemPackages = with pkgs; [ - adwsteamgtk - ]; - programs = { - steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - gamescopeSession.enable = true; - protontricks.enable = true; - extraCompatPackages = with pkgs; [ - proton-ge-bin - ]; - extraPackages = with pkgs; [ - gamescope - ]; - }; - gamescope = { - enable = true; - capSysNice = true; - }; - }; - }; - -}