summary refs log tree commit diff
path: root/nixos/modules/services/games/factorio.nix
diff options
context:
space:
mode:
authorThe-M1k3y <tobias.eisenhardt@onlinehome.de>2017-11-23 13:50:19 +0100
committerThe-M1k3y <tobias.eisenhardt@onlinehome.de>2017-11-23 13:50:19 +0100
commit7dcd299e9a1ee7b13dcdf1a8d47f8ca25cddf9d9 (patch)
treec6086666b8ab15bc6eaa75c72c6d075d2845f57a /nixos/modules/services/games/factorio.nix
parent3db0f9d1e330435156e078bf53360b9054e3e898 (diff)
downloadnixlib-7dcd299e9a1ee7b13dcdf1a8d47f8ca25cddf9d9.tar
nixlib-7dcd299e9a1ee7b13dcdf1a8d47f8ca25cddf9d9.tar.gz
nixlib-7dcd299e9a1ee7b13dcdf1a8d47f8ca25cddf9d9.tar.bz2
nixlib-7dcd299e9a1ee7b13dcdf1a8d47f8ca25cddf9d9.tar.lz
nixlib-7dcd299e9a1ee7b13dcdf1a8d47f8ca25cddf9d9.tar.xz
nixlib-7dcd299e9a1ee7b13dcdf1a8d47f8ca25cddf9d9.tar.zst
nixlib-7dcd299e9a1ee7b13dcdf1a8d47f8ca25cddf9d9.zip
nixos/factorio: add stateDir and requireUserVerification option
Diffstat (limited to 'nixos/modules/services/games/factorio.nix')
-rw-r--r--nixos/modules/services/games/factorio.nix20
1 files changed, 18 insertions, 2 deletions
diff --git a/nixos/modules/services/games/factorio.nix b/nixos/modules/services/games/factorio.nix
index 1dc8ce93a0e5..3f6bf9de8931 100644
--- a/nixos/modules/services/games/factorio.nix
+++ b/nixos/modules/services/games/factorio.nix
@@ -6,7 +6,7 @@ let
   cfg = config.services.factorio;
   factorio = pkgs.factorio-headless;
   name = "Factorio";
-  stateDir = "/var/lib/factorio";
+  stateDir = cfg.stateDir;
   mkSavePath = name: "${stateDir}/saves/${name}.zip";
   configFile = pkgs.writeText "factorio.conf" ''
     use-system-read-write-data-directories=true
@@ -25,7 +25,7 @@ let
     password = cfg.password;
     token = cfg.token;
     game_password = cfg.game-password;
-    require_user_verification = true;
+    require_user_verification = cfg.requireUserVerification;
     max_upload_in_kilobytes_per_second = 0;
     minimum_latency_in_ticks = 0;
     ignore_player_limit_for_returning_players = false;
@@ -80,6 +80,15 @@ in
           customizations.
         '';
       };
+      stateDir = mkOption {
+        type = types.path;
+        default = "/var/lib/factorio";
+        description = ''
+          The server's data directory.
+
+          The configuration and map will be stored here.
+        '';
+      };
       mods = mkOption {
         type = types.listOf types.package;
         default = [];
@@ -148,6 +157,13 @@ in
           Game password.
         '';
       };
+      requireUserVerification = mkOption {
+        type = types.bool;
+        default = true;
+        description = ''
+          When set to true, the server will only allow clients that have a valid factorio.com account.
+        '';
+      };
       autosave-interval = mkOption {
         type = types.nullOr types.int;
         default = null;