mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 06:14:26 +03:00
nixos/factorio: add stateDir and requireUserVerification option
This commit is contained in:
parent
3db0f9d1e3
commit
7dcd299e9a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user