From b44d03dece211826804ae7305b4abb40cde71624 Mon Sep 17 00:00:00 2001 From: Myned Date: Fri, 7 Mar 2025 18:23:15 -0600 Subject: [PATCH] custom: add games options Signed-off-by: Myned --- machines/mynix/default.nix | 5 +++++ options/custom/settings/games.nix | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 options/custom/settings/games.nix diff --git a/machines/mynix/default.nix b/machines/mynix/default.nix index 90c0018..1979939 100644 --- a/machines/mynix/default.nix +++ b/machines/mynix/default.nix @@ -26,6 +26,11 @@ }; settings = { + games = { + enable = true; + abiotic-factor = true; + }; + storage.mnt = [ "gayme" "gaymer" diff --git a/options/custom/settings/games.nix b/options/custom/settings/games.nix new file mode 100644 index 0000000..7d2fdf2 --- /dev/null +++ b/options/custom/settings/games.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.games; +in { + options.custom.settings.games = { + enable = mkOption {default = false;}; + abiotic-factor = mkOption {default = false;}; + }; + + config = mkIf cfg.enable { + networking.firewall = { + # https://github.com/DFJacob/AbioticFactorDedicatedServer + allowedTCPPorts = optionals cfg.abiotic-factor [ + 7777 + 27015 + ]; + }; + }; +}