summaryrefslogtreecommitdiff
path: root/modules/games.nix
diff options
context:
space:
mode:
authorLeonardo Santiago <[email protected]>2024-09-12 21:44:46 -0300
committerLeonardo Santiago <[email protected]>2024-09-12 23:20:51 -0300
commit62100c9265a4de389d1ea8060cbddddacde161a7 (patch)
tree811ca1c5803ccdb2670f0c239214bc0dc30f57c7 /modules/games.nix
parentf9ddec7952709d7b5d5d79deadca07c573510d49 (diff)
split users/leonardo.nix into modules with options
in order to be able to deploy just a few of those to iori.nix
Diffstat (limited to 'modules/games.nix')
-rw-r--r--modules/games.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/games.nix b/modules/games.nix
new file mode 100644
index 0000000..d47254d
--- /dev/null
+++ b/modules/games.nix
@@ -0,0 +1,27 @@
+{ config, lib, pkgs, ... }: let
+ cfg = config.santi-modules;
+in with lib; {
+ options.santi-modules = {
+ games.enable = mkEnableOption "Enable all games";
+ steam.enable = mkOption {
+ description = "Enable steam installation";
+ default = cfg.games.enable;
+ type = types.bool;
+ };
+ minecraft.enable = mkOption {
+ description = "Enable minecraft launcher";
+ default = cfg.games.enable;
+ type = types.bool;
+ };
+ };
+ config = {
+ programs.steam = mkIf cfg.steam.enable {
+ enable = true;
+ remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
+ dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
+ };
+ environment.systemPackages = mkIf cfg.minecraft.enable [
+ pkgs.prismlauncher
+ ];
+ };
+}