summaryrefslogtreecommitdiff
path: root/modules/gaming
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gaming')
-rw-r--r--modules/gaming/default.nix19
-rw-r--r--modules/gaming/homestuck.nix19
-rw-r--r--modules/gaming/minecraft.nix17
-rw-r--r--modules/gaming/steam.nix34
4 files changed, 89 insertions, 0 deletions
diff --git a/modules/gaming/default.nix b/modules/gaming/default.nix
new file mode 100644
index 0000000..a0c826c
--- /dev/null
+++ b/modules/gaming/default.nix
@@ -0,0 +1,19 @@
+{
+ lib,
+ config,
+ ...
+}: let
+ inherit (lib) mkEnableOption;
+in {
+ imports = [
+ ./homestuck.nix
+ ./minecraft.nix
+ ./steam.nix
+ ];
+
+ options.gaming = {
+ homestuck = mkEnableOption "Install the unofficial homestuck collection.";
+ minecraft = mkEnableOption "Install the minecraft block game.";
+ steam = mkEnableOption "Install the steam game launcher.";
+ };
+}
diff --git a/modules/gaming/homestuck.nix b/modules/gaming/homestuck.nix
new file mode 100644
index 0000000..12641a4
--- /dev/null
+++ b/modules/gaming/homestuck.nix
@@ -0,0 +1,19 @@
+{
+ lib,
+ config,
+ pkgs,
+ inputs,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.gaming;
+ system = pkgs.stdenv.hostPlatform.system;
+in {
+ config = mkIf cfg.homestuck {
+ home-manager.users.${config.user} = {
+ home.packages = [
+ inputs.self.packages.${system}.unofficial-homestuck-collection
+ ];
+ };
+ };
+}
diff --git a/modules/gaming/minecraft.nix b/modules/gaming/minecraft.nix
new file mode 100644
index 0000000..5de20e6
--- /dev/null
+++ b/modules/gaming/minecraft.nix
@@ -0,0 +1,17 @@
+{
+ lib,
+ config,
+ pkgs,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.gaming;
+in {
+ config = mkIf cfg.minecraft {
+ home-manager.users.${config.user} = {
+ home.packages = with pkgs; [
+ prismlauncher
+ ];
+ };
+ };
+}
diff --git a/modules/gaming/steam.nix b/modules/gaming/steam.nix
new file mode 100644
index 0000000..53ab252
--- /dev/null
+++ b/modules/gaming/steam.nix
@@ -0,0 +1,34 @@
+{
+ lib,
+ config,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.gaming;
+in {
+ config = mkIf cfg.steam {
+ nixpkgs.config.allowUnfreePredicate = pkg:
+ builtins.elem (lib.getName pkg) [
+ "steam"
+ "steam-original"
+ "steam-runtime"
+ ];
+
+ programs.gamescope = {
+ enable = true;
+ capSysNice = true;
+ };
+
+ programs.steam = {
+ enable = true;
+ remotePlay.openFirewall = true;
+ dedicatedServer.openFirewall = true;
+ localNetworkGameTransfers.openFirewall = true;
+ gamescopeSession.enable = true;
+ };
+
+ # controllers
+ hardware.xone.enable = true;
+ hardware.steam-hardware.enable = true;
+ };
+}