factorio: make it easier to supply a custom versions.json

Signed-off-by: Daniel Hill <daniel@gluo.nz>
This commit is contained in:
Daniel Hill 2022-10-31 22:38:57 +13:00
parent dfb35cb5bd
commit a1115f5ea5

View File

@ -3,6 +3,7 @@
, libSM, libICE, libXext, factorio-utils
, releaseType
, mods ? []
, versionsJson ? ./versions.json
, username ? "", token ? "" # get/reset token at https://factorio.com/profile
, experimental ? false # true means to always use the latest branch
}:
@ -60,7 +61,7 @@ let
# NB `experimental` directs us to take the latest build, regardless of its branch;
# hence the (stable, experimental) pairs may sometimes refer to the same distributable.
versions = importJSON ./versions.json;
versions = importJSON versionsJson;
binDists = makeBinDists versions;
actual = binDists.${stdenv.hostPlatform.system}.${releaseType}.${branch} or (throw "Factorio ${releaseType}-${branch} binaries for ${stdenv.hostPlatform.system} are not available for download.");