Add support for various game platforms
Steam:
Steam is useful on NixOS, not only for playng games but also for
running programs inside its FHS. Therefore, when installing steam we
also opted to install steam-run, which will let us use this easily
Itch:
Itch may not be the place where we go for games the most, but it's
still got its place. We decided to add it because we own significant
numbers of games on it (after Racial Justice and Equality bundle and
other similar bundles).
Minecraft (PrismLauncher):
We love Minecraft, and we love PrismLauncher. So, by default, when
you enable Minecraft we will install PrismLauncher. If you don't like
PrismLauncher, you may install your own by setting
chimera.games.minecraft.launcher.package to the package you would like
Change-Id: I0c1767e532beccf1f9020b321dc954b66a442d93
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/523
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/homes/x86_64-linux/minion@greylag/default.nix b/homes/x86_64-linux/minion@greylag/default.nix
index 0bf17a5..101a6bd 100644
--- a/homes/x86_64-linux/minion@greylag/default.nix
+++ b/homes/x86_64-linux/minion@greylag/default.nix
@@ -144,6 +144,11 @@
};
shell.usefulPackages.enable = true;
+
+ games = {
+ minecraft.enable = true;
+ itch.enable = true;
+ };
};
services.nextcloud-client = {
diff --git a/modules/home/games/itch/default.nix b/modules/home/games/itch/default.nix
new file mode 100644
index 0000000..71e543b
--- /dev/null
+++ b/modules/home/games/itch/default.nix
@@ -0,0 +1,7 @@
+{ config, lib, pkgs, ... }: {
+ options.chimera.games.itch.enable = lib.mkEnableOption "Enable Itch.io Client";
+
+ config = {
+ home.packages = lib.mkIf config.chimera.games.itch.enable [ pkgs.itch ];
+ };
+}
\ No newline at end of file
diff --git a/modules/home/games/minecraft/default.nix b/modules/home/games/minecraft/default.nix
new file mode 100644
index 0000000..5e91f96
--- /dev/null
+++ b/modules/home/games/minecraft/default.nix
@@ -0,0 +1,16 @@
+{ config, lib, pkgs, ... }: {
+ options = {
+ chimera.games.minecraft = {
+ enable = lib.mkEnableOption "Enable Minecraft";
+ launcher.package = lib.mkOption {
+ type = lib.types.package;
+ default = pkgs.prismlauncher;
+ example = pkgs.atlauncher;
+ };
+ };
+ };
+
+ config = {
+ home.packages = lib.mkIf config.chimera.games.minecraft.enable [ config.chimera.games.minecraft.launcher.package ];
+ };
+}
\ No newline at end of file
diff --git a/modules/nixos/games/steam/default.nix b/modules/nixos/games/steam/default.nix
new file mode 100644
index 0000000..06a9a9a
--- /dev/null
+++ b/modules/nixos/games/steam/default.nix
@@ -0,0 +1,23 @@
+{ config, lib, pkgs, ... }:
+{
+ options = {
+ chimera.games.steam.enable = lib.mkEnableOption "Enable Steam";
+ };
+
+ config = {
+ programs.steam = lib.mkIf config.chimera.games.steam.enable {
+ enable = true;
+ remotePlay.openFirewall = true;
+
+ package = pkgs.steam.override
+ {
+ extraLibraries = pkgs: [ config.hardware.opengl.package ] ++ config.hardware.opengl.extraPackages;
+ };
+ };
+ hardware.steam-hardware.enable = true;
+
+ environment.systemPackages = [
+ pkgs.steam-run
+ ];
+ };
+}
diff --git a/systems/x86_64-linux/greylag/default.nix b/systems/x86_64-linux/greylag/default.nix
index 7f13313..fd24dac 100644
--- a/systems/x86_64-linux/greylag/default.nix
+++ b/systems/x86_64-linux/greylag/default.nix
@@ -7,6 +7,7 @@
./console
./cpu
./firmware
+ ./games
./networking
./time
./users
diff --git a/systems/x86_64-linux/greylag/games/default.nix b/systems/x86_64-linux/greylag/games/default.nix
new file mode 100644
index 0000000..3055a58
--- /dev/null
+++ b/systems/x86_64-linux/greylag/games/default.nix
@@ -0,0 +1,3 @@
+{
+ chimera.games.steam.enable = true;
+}
\ No newline at end of file
diff --git a/systems/x86_64-linux/shorthair/default.nix b/systems/x86_64-linux/shorthair/default.nix
index 02f4864..ffb1dd0 100644
--- a/systems/x86_64-linux/shorthair/default.nix
+++ b/systems/x86_64-linux/shorthair/default.nix
@@ -1,10 +1,11 @@
{ ... }:
{
imports = [
- ./hardware/boot
- ./hardware/filesystems
- ./hardware/cpu
./console
+ ./games
+ ./hardware/boot
+ ./hardware/cpu
+ ./hardware/filesystems
./networking
./openrgb
./users
diff --git a/systems/x86_64-linux/shorthair/games/default.nix b/systems/x86_64-linux/shorthair/games/default.nix
new file mode 100644
index 0000000..aa603bc
--- /dev/null
+++ b/systems/x86_64-linux/shorthair/games/default.nix
@@ -0,0 +1,3 @@
+{ ... }: {
+ chimera.games.steam.enable = true;
+}
\ No newline at end of file