nixos/factorio: add stateDir and requireUserVerification option

+18 -2
+18 -2
nixos/modules/services/games/factorio.nix
··· 6 6 cfg = config.services.factorio; 7 7 factorio = pkgs.factorio-headless; 8 8 name = "Factorio"; 9 - stateDir = "/var/lib/factorio"; 9 + stateDir = cfg.stateDir; 10 10 mkSavePath = name: "${stateDir}/saves/${name}.zip"; 11 11 configFile = pkgs.writeText "factorio.conf" '' 12 12 use-system-read-write-data-directories=true ··· 25 25 password = cfg.password; 26 26 token = cfg.token; 27 27 game_password = cfg.game-password; 28 - require_user_verification = true; 28 + require_user_verification = cfg.requireUserVerification; 29 29 max_upload_in_kilobytes_per_second = 0; 30 30 minimum_latency_in_ticks = 0; 31 31 ignore_player_limit_for_returning_players = false; ··· 80 80 customizations. 81 81 ''; 82 82 }; 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 + }; 83 92 mods = mkOption { 84 93 type = types.listOf types.package; 85 94 default = []; ··· 146 155 default = null; 147 156 description = '' 148 157 Game password. 158 + ''; 159 + }; 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. 149 165 ''; 150 166 }; 151 167 autosave-interval = mkOption {