@@ -6,7 +6,7 @@ let
66 cfg = config.services.factorio;
77 factorio = pkgs.factorio-headless;
88 name = "Factorio";
9− stateDir = "/var/lib/factorio";
9+ stateDir = cfg.stateDir;
1010 mkSavePath = name: "${stateDir}/saves/${name}.zip";
1111 configFile = pkgs.writeText "factorio.conf" ''
1212 use-system-read-write-data-directories=true
@@ -25,7 +25,7 @@ let
2525 password = cfg.password;
2626 token = cfg.token;
2727 game_password = cfg.game-password;
28− require_user_verification = true;
28+ require_user_verification = cfg.requireUserVerification;
2929 max_upload_in_kilobytes_per_second = 0;
3030 minimum_latency_in_ticks = 0;
3131 ignore_player_limit_for_returning_players = false;
@@ -80,6 +80,15 @@ in
8080 customizations.
8181 '';
8282 };
83+ stateDir = mkOption {
84+ type = types.path;
85+ default = "/var/lib/factorio";
86+ description = ''
87+ The server's data directory.
88+
89+ The configuration and map will be stored here.
90+ '';
91+ };
8392 mods = mkOption {
8493 type = types.listOf types.package;
8594 default = [];
@@ -148,6 +157,13 @@ in
148157 Game password.
149158 '';
150159 };
160+ requireUserVerification = mkOption {
161+ type = types.bool;
162+ default = true;
163+ description = ''
164+ When set to true, the server will only allow clients that have a valid factorio.com account.
165+ '';
166+ };
151167 autosave-interval = mkOption {
152168 type = types.nullOr types.int;
153169 default = null;