nixos/factorio: add stateDir and requireUserVerification option

Changed files
+18 -2
nixos
modules
services
games
+18 -2
nixos/modules/services/games/factorio.nix
···
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
···
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;
···
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 = [];
···
default = null;
description = ''
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 {